Watchman crawl failed. Retrying once with node crawler. Usually this happens when watchman isn't running. Create an empty
.watchmanconfig
file in your project's root folder or initialize a git or hg repository in your project.Error: watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2018-03-23T11:33:13,360: [0x7fff9755f3c0] the owner of /usr/local/var/run/watchman/root-state is uid 501 and doesn't match your euid 0
You're running watchman as root but the state dir, which may contain trigger definitions and thus allow spawning arbitrary commands, is not owned by root. This is a security issue and thus watchman is refusing to start.
The safest way to resolve this is to remove the state dir by running:
rm -rf /usr/local/var/run/watchman/root-state
I'd recommend that you avoid running tools that wish to use watchman using sudo
to avoid this happening again.
Testing with jest:
Step 1:
watchman watch-del-all
Step 2:
watchman shutdown-server
watchman shutdown-server
helped to ask the access to my documents and to have watchman working again. –
Kwei You're running watchman as root but the state dir, which may contain trigger definitions and thus allow spawning arbitrary commands, is not owned by root. This is a security issue and thus watchman is refusing to start.
The safest way to resolve this is to remove the state dir by running:
rm -rf /usr/local/var/run/watchman/root-state
I'd recommend that you avoid running tools that wish to use watchman using sudo
to avoid this happening again.
As Jodie suggested above I tried the below and it worked well, for the benefit of others mentioning below steps which I tried in my mac to fix this issue
- First, Kill all the server running and close your terminal.
- Go to 'System preferences' -> 'Security & Privacy' -> privacy tab
- Scroll down and click 'Full Disk Access'
- Make sure you checked on 'Terminal' and 'Watchman'.
- Now relaunch terminal and simply try running again it works!!
watchman watch-del-all
watchman shutdown-server
Worked on MAC with no problem.
-June 8 2022
Giving Full Disk Access to all terminals or where you're getting started your server, is fixed the error. Also, it would be good to give access (Files and Folders) to VSC.
Here are the steps to do it!
- Open System Preferences
- Find Security & Privacy option and open it
- Give Full Disk Access to your terminals, Xcode and VSC.
Happy Hacking!!!
This error started to me when I ran the command npx react-native-clean-project
, and with this step mentioned above, my case was solutioned.
Step 1:
watchman watch-del-all
Step 2:
watchman shutdown-server
I had a real issue with this one but finally found the answer.
Here's a screenshot of the post that helped me.
https://github.com/facebook/watchman/issues/751#issuecomment-542300670
The whole forum has multiple different solutions which I hadn't actually tried, but this one is the solution that worked for me! Hope this helps.
check for .watchmanconfig and add this {}.
Inside the file .watchmanconfig
{}
Simple as that just try it.
I solved this, on linux by using the following commands on terminal.
$ echo 256 | sudo tee -a /proc/sys/fs/inotify/max_user_instances
$ echo 32768 | sudo tee -a /proc/sys/fs/inotify/max_queued_events
$ echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches
$ pkill node
Then:
$ npm start
or
$ expo start (if you are using expo)
watchman watch-del-all && rm -f yarn.lock && rm -rf node_modules && yarn && yarn start -- --reset-cache
If you're not actually using watchman with Jest just set watchman: false
in your jest.config.js
to stop this message when running tests.
Step 1: $ npm cache clean --force
Step 2: Delete node_modules: $ rm -rf node_modules
Step 3: npm install
Step 4? (Optional): yarn start
/ npm start
This worked for me. Hopes it works for you too.
A quick solution is to kill watchman server by entering this command line in your terminal:
watchman shutdown-server
Put your project in a shared folder (ie, Macintosh HD/Users/Shared. I kept getting operation denied on the Desktop, because of further protection policies, even though Full Disk Access was granted.
To solve this issue on my end, i had to stop the other node instance running on my other terminal. Just make sure you don't have another node running on your machine.
Watchman config file
I set my .watchconfig file to be extra permissible: Add this code to your .watchmanconfig file
{
"ignore_dirs": [],
"fsevents_latency": 0.5,
"fsevents_try_resync": true
}
// In jest.config.js, set watchmen to false.
module.exports = {
//other options ...
watchman: false,
};
The simplest way is to kill watchman server using the following command line:
watchman shutdown-server
Then you can remove the recored files changes using this command:
watchman watch-del-all
That's all.
© 2022 - 2024 — McMap. All rights reserved.