react-nativewatchman

Failed to start Watchman watch mode


I am developing a React Native app. My code is error free, but it is facing build problems. I get an error in the Metro Bundler when I execute the command react-native run-android. The error says:

UnhandledPromiseRejectionWarning: Failed to start watch mode.

I also tried adding Watchman to node_modules using the command $yarn add watchman. I get a prompt that it is deprecated.

How should I solve the error?

My package.json contains the following:

"dependencies": {
    "expo": "^25.0.0",
    "native-base": "^2.3.7",
    "react": "16.2.0",
    "react-native": "0.52.0",
    "react-native-vector-icons": "^4.5.0",
    "react-navigation": "^1.0.0-beta.27",
    "watchman": "^1.0.0"
}

"devDependencies": {
    "babel-jest": "22.1.0",
    "babel-preset-react-native": "4.0.0",
    "jest": "22.1.3",
    "react-test-renderer": "16.2.0"
  }

Solution

  • To have watchman in windows do the following:
    (1)Download watchman zip file from the link here
    (2) Unzip the folder
    (3) Place the watchman.exe file in the folder that is registered in the PATH (environment variable) (Eg: Place the watchman.exe file in C:/ProgramFiles/ and make sure the PATH = 'C:/ProgramFiles')

    Done! You would never face this error again!