Mandar Belkunde
Mandar Belkunde

Reputation: 934

Watchman crawl failed. Retrying once with node crawler

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

Upvotes: 83

Views: 84780

Answers (22)

Dylan w
Dylan w

Reputation: 2906

On mac, I was getting the error and tried the below first

watchman watch-del-all
watchman shutdown-server

It did not work, following troubleshooting documentation this worked:

watchman shutdown-server
brew update
brew reinstall watchman

Source: https://facebook.github.io/watchman/docs/troubleshooting

Upvotes: 0

just stop server then run command

watchman watch-del-all

watchman shutdown-server

Upvotes: 0

Umer Nazir
Umer Nazir

Reputation: 1

In my case, the issue was that 'watchman' wasn't listed under Full Disk Access in macOS settings. To resolve it, I manually added 'watchman' to Full Disk Access in the Privacy settings. Once I did that, everything worked perfectly.

Upvotes: 0

Mustapha GHLISSI
Mustapha GHLISSI

Reputation: 1730

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.

Upvotes: 0

Mustapha GHLISSI
Mustapha GHLISSI

Reputation: 1730

A quick solution is to kill watchman server by entering this command line in your terminal:

watchman shutdown-server

Upvotes: 1

Neta
Neta

Reputation: 111

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

Upvotes: 11

KISHORE K J
KISHORE K J

Reputation: 624

// In jest.config.js, set watchmen to false.

module.exports = {
  //other options ...
  watchman: false,
};

Upvotes: 0

Luke Watts
Luke Watts

Reputation: 694

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.

Upvotes: 3

Drew Knowles
Drew Knowles

Reputation: 121

  1. watchman watch-del-all

  2. watchman shutdown-server

Worked on MAC with no problem.

Upvotes: 8

Jeffox
Jeffox

Reputation: 3469

Testing with jest:

Step 1:

watchman watch-del-all

Step 2:

watchman shutdown-server

Upvotes: 290

Bilal Yaqoob
Bilal Yaqoob

Reputation: 997

watchman watch-del-all && rm -f yarn.lock && rm -rf node_modules && yarn && yarn start -- --reset-cache

Upvotes: 2

Myda Afzal
Myda Afzal

Reputation: 1

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
}

Upvotes: 0

Vishnu Vardhan
Vishnu Vardhan

Reputation: 61

check for .watchmanconfig and add this {}.

Inside the file .watchmanconfig

{}

Simple as that just try it.

Upvotes: 3

gibs gibre
gibs gibre

Reputation: 1

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.

Upvotes: 0

Dwaine
Dwaine

Reputation: 1453

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.

Upvotes: 0

Erencan
Erencan

Reputation: 220

-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!

  1. Open System Preferences

enter image description here

  1. Find Security & Privacy option and open it

enter image description here

  1. Give Full Disk Access to your terminals, Xcode and VSC.

enter image description here

Happy Hacking!!!

Upvotes: 7

Felix Too
Felix Too

Reputation: 11941

On a Mac, remove all watches and associated triggers of running process, then shutdown the service. See screenshot below: enter image description here

Upvotes: 0

Mateus Degobi
Mateus Degobi

Reputation: 21

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.

Upvotes: 2

jaishankar
jaishankar

Reputation: 289

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

  1. First, Kill all the server running and close your terminal.
  2. Go to 'System preferences' -> 'Security & Privacy' -> privacy tab
  3. Scroll down and click 'Full Disk Access'
  4. Make sure you checked on 'Terminal' and 'Watchman'.
  5. Now relaunch terminal and simply try running again it works!!

Upvotes: 18

Evair Silvester
Evair Silvester

Reputation: 23

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)

Upvotes: 2

Jodie
Jodie

Reputation: 31

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.

Upvotes: 3

Wez Furlong
Wez Furlong

Reputation: 4987

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.

Upvotes: 34

Related Questions