Reputation: 173
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"
}
Upvotes: 3
Views: 17976
Reputation: 11
Try closing all the opened terminals in vs code or in windows and try running again.
Upvotes: 0
Reputation: 1
same issue I got on metro Android
I tried the following Steps:-
1.npx react-native start --reset-cache
2.cd android && ./gradlew clean && cd..
3.npx react-native run-android
In mac, I used
watchman watch-del-all
on Terminal
then I re-run the XCode. It's working
Upvotes: 0
Reputation: 809
I tried the following:
Most of the times the above methods worked but not always. So, here's one-time permanent solution (for Windows)
Upvotes: 0
Reputation: 41
I have also faced the same issue.Then I have
The above steps helped me to resolve the error.
Upvotes: 3
Reputation: 11
Failed to start Watchman watch mode (Windows)
I tried a lot to fixed the issue and at last, I restart my windows now it's working.
Upvotes: -1
Reputation: 173
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!
Upvotes: 9