'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 1:[1]
You have to install watchman using brew:
brew install watchman
Solution 2:[2]
in windows npm install watchman
Solution 3:[3]
I have also faced the same issue.Then I have
- Deleted the node modules and installed them again by using npm install.
- Then clean gradle by '.\gradlew'
- Then run the app by 'npx react-native run-android'.
The above steps helped me to resolve the error.
Solution 4:[4]
I tried the following:
- Restarting my system
- Deleting npm/yarn cache.
Most of the times the above methods worked but not always. So, here's one-time permanent solution (for Windows)
- Download the Watchman v2021.01.11
- Unzip, Rename the folder "Watchman" and paste the C:/Program Files.
- Open the folder and copy the location of bin folder (would be C:/Program Files/Watchman/bin)
- Go to Environment variables, search of PATH variable and append the copied location of bin
Solution 5:[5]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Michal |
| Solution 2 | art_cs |
| Solution 3 | Nk54 |
| Solution 4 | Rahul |
| Solution 5 | lak singh |
