Reputation: 2322
Trying to run react-native run-ios
or build RN project from xcode, as soon as metro bundler starts, this error appears in the terminal:
Loading dependency graph...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: resolve_projpath: path `/Users/vorousjames/Desktop/Development/TicTacWHOA/app/TicTacWHOA`: open: /Users/vorousjames/Desktop/Development/TicTacWHOA/app/TicTacWHOA: Operation not permitted. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.html.
events.js:183
throw er; // Unhandled 'error' event
^
Error: resolve_projpath: path `/Users/vorousjames/Desktop/Development/TicTacWHOA/app/TicTacWHOA`: open: /Users/vorousjames/Desktop/Development/TicTacWHOA/app/TicTacWHOA: Operation not permitted
at BunserBuf.<anonymous> (/Users/vorousjames/Desktop/Development/TicTacWHOA/app/TicTacWHOA/node_modules/fb-watchman/index.js:95:23)
at emitOne (events.js:116:13)
at BunserBuf.emit (events.js:211:7)
at BunserBuf.process (/Users/vorousjames/Desktop/Development/TicTacWHOA/app/TicTacWHOA/node_modules/bser/index.js:292:10)
at /Users/vorousjames/Desktop/Development/TicTacWHOA/app/TicTacWHOA/node_modules/bser/index.js:247:12
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
This never happened before the Catalina update. I've had an empty watchman config file in the root of my project since the beginning. On first boot post-update, there was a popup in terminal saying something about permissions but i dont remember exactly. there's also a notice in my terminal in visual studio code saying "the default shell changed to zsh" run chsh -s /bin/zsh
to change, so i did.
I've tried:
watchman watch-del-all
watchman server-shutdown
adding full disk access to terminal from within system preferences->privacy tab
npm uninstall watchman
& npm uninstall -g watchman
Upvotes: 23
Views: 44590
Reputation: 441
I had the same error on macOS with iPhone 15 Pro iOS emulator. I tried to use these commands and worked for me.
$ watchman shutdown-server
$ watchman watch-del-all
Upvotes: 1
Reputation: 4889
It is related that Documents
or another folder permission is privacy.
Try to sudo
to access terminal as below.
brew reinstall watchman
(optional)sudo npx react-native start
terminal.Upvotes: 1
Reputation: 630
First run watchman watch-del-all
then run watchman shutdown-server
fixed my issue
Upvotes: 44
Reputation: 1761
As a temporary workaround, you can move your project to your home folder and it should run successfully.
To open your home folder, press Command-Shift-H.
(As of June 2022, there seems to be an issue with the 2022.05.30.00 version of Watchman, and this temporary solution is the only way I have been able to get around the issue.)
Upvotes: -1
Reputation: 460
There is only one solution at the moment. Move your project from the "Desktop" or "Documents" folder to the main folder (~/). None of the other ways worked for me.
This is because MacOS now asks for permissions for these folders (example in the image below). I guess this hasn't been added to the watchman yet.
Upvotes: -1
Reputation: 9
For me above scenario didn't work, so I tried with different solution which solved the problem for me. (I am using MacBook Pro, chip: Apple M1 pro)
At first you have to update the setting of your Mac OS
System Preference >> security & privacy >> privacy tab >> Full disk access >> click on the lock icon >> checkmark for terminal
Sometime using this steps you are able to resolve the issue, but after this, if you are still facing issue, please use this link: #1030 (comment)
Upvotes: 0
Reputation: 890
You need to grant disk access to watchman
. To do this You need to:
System preferences
> Security & Privacy
then scroll downFull Disk Access
+
button to add new app/toolMacintosh HD
in the folders listshift
Command
.
at the same time to see all the directories listopt > brew > bin
(watchman is installed in this folder for MacOS Catalina) || usr > local > Cellar > Watchman > 21***** > bin
(watchman is installed in this folder MacOS Monterey)watchman
in the list then select itHere we go, this should fix the issue.
Upvotes: 43
Reputation: 1127
You need to change something its works for me. follow only following steps:
1. Go to System preferences > Security & Privacy then scroll down.
2. Select Full Disk Access.
3. Look for all watchmen on the list.
4. check(Mark) all Folders in all watchman files.
5. then go to vs code.
6. rebuilt your code.
I hope it will work smoothly
Upvotes: 2
Reputation: 538
Just uncheck the repeated boxes in Mac:
System Preferences -> Security and privacy -> Privacy
Upvotes: 0
Reputation: 504
I had the same issue after updating to Catalina. Wez Furlong's answer worked for me, but I had to provide full disk access to watchman in order to run watchman watch-project command without getting "Operation not permitted" error. As part of prior troubleshooting, I also had provided full disk access to Xcode and Terminal (not sure if this also contributed to the fix).
Upvotes: 27
Reputation: 449
To change the permissions for Watchman regarding the Documents folder, it's under Security & Privacy -> files & folders in the system preferences
My issue was resolved by checking Watchman in the list under Document folder
Upvotes: 15
Reputation: 9
Try to change the directory of your project. I had mine on desktop and was getting that error, moved to the home folder and the error is gone
Upvotes: 0
Reputation: 4987
The error message indicates a permission problem on /Users/vorousjames/Desktop/Development/TicTacWHOA/app/TicTacWHOA
.
However, it may be something funky with launchd, so I would suggest:
$ watchman shutdown-server
$ launchctl unload ~/Library/LaunchAgents/com.github.facebook.watchman.plist
$ rm ~/Library/LaunchAgents/com.github.facebook.watchman.plist
$ watchman watch-project /Users/vorousjames/Desktop/Development/TicTacWHOA/app/TicTacWHOA
and see if that works or shows more context.
Cross linking back to an issue in our GitHub tracker: https://github.com/facebook/watchman/issues/751
Upvotes: 2