Dongjae0324
Dongjae0324

Reputation: 113

jest-haste-map: Watchman crawl failed. Retrying once with node crawler

I just found an error while running the metro of react native it came after upgrading the os

the error was

    jest-haste-map: 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 error: std::__1::system_error: open: /Users/dongjae/Desktop/wellCupOfficial/wellcupOfficial/wellcupApp: Operation not permitted. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.
/Users/dongjae/Desktop/wellCupOfficial/wellcupOfficial/wellcupApp/node_modules/metro-hermes-compiler/src/emhermesc.js:77
          throw ex;

after googling it and trying some soulutions for 3hours? i found that i had to add "watchman" to Full Disk Access under Security&Privacy

Also I found that watchman is in dir opt/local/bin/watchman However, the biggest problem is that I have found no way to access to this folder I can't even see this folder in the selecting window Please help this poor developer..

Upvotes: 11

Views: 12080

Answers (7)

Erick
Erick

Reputation: 1146

I was facing an issue that Watchman was not present in the list to allow for full disk access on Mac m1.

I managed to fix this by

  1. Go to System preferences > Security & Privacy
  2. Select Full Disk Access
  3. click + button to add new
  4. You need to select Macintosh HD from the folders list
  5. Press this combination Shift + Command + . together to view all the directories list
  6. Click opt > homebrew > bin (watchman is installed in this folder for MacOS Catalina)
NOTE: If you do not find it here. open the terminal and run

> which watchman

This should give you the installed path for watchman. 
  1. Open watchman and it should show the watchman in the list to select for full disk access.

Once I had watchman selected in the full disk access, I restarted my VSCode and the error was gone.

Upvotes: 1

edrich13
edrich13

Reputation: 829

try this it worked for me

$ watchman watch-del-all
$ watchman shutdown-server

Upvotes: 35

Richard Boyewa
Richard Boyewa

Reputation: 321

In the root of your project, run watchman watch-del-all, then run watchman shutdown-server. The next time you run the app you will be prompted to give access to watchman. This should resolve the issue.

Upvotes: 13

B. Mohammad
B. Mohammad

Reputation: 2464

On macOS I had to run sudo yarn start it worked and the system showed an alert to give watchman read rights, after accepting yarn start can run normally without sudo.

Upvotes: 0

manirikhi
manirikhi

Reputation: 149

Hope this will be helpful. worked for me.

You should move the entire project directory outside of the Documents or Download directory for mac

https://github.com/facebook/watchman/issues/977

Upvotes: 2

Nicolas
Nicolas

Reputation: 538

Try to move outside the Desktop folder. I've moved my projects to my User folder, and everything works.

Strange, yes. But at least at the moment, I can continue coding.

Upvotes: 1

Suman Thapa Magar
Suman Thapa Magar

Reputation: 269

Reset your project

git reset --hard

Delete Node modules if you have to

Upvotes: -2

Related Questions