watchman: Operation not permitted
Try to build react native clear project and getting watchman error:
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/sliokkory/Documents/myteam/star: Operation not permitted. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.
Watchman -v: 2021.11.15.00 MacOs: 12.0.1 Monterey (m1)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 7
- Comments: 57
First run
watchman watch-del-allthen runwatchman shutdown-serverfixed my issueHi. You should move the entire project directory outside of the Documents directory
FIXED!
Is there a permanent fix for this? Moving my project to another folder is not a fix.
I had my project inside Documents folder too and was receiving the same error as the OP when I ran
npx react-native startAs mentioned by someone else, it happens due to macOS making Documents directory private by default.
To fix the issue, I did the following:
sudo npx react-native startCtrl+C.npx react-native startHope it helps others.
Privacy & Security -> Files and Folders
Просто перенес в корень, и то-же сработало
Yep have to be right under Users/myuser/ directory. If you placed them under other folders it still not working for example Users/myuser/Download/
Is this something that has been changed recently or just specific for M1 chips because i have always been working on react native apps and using it inside my documents folder but just today, It appeared that i got that error too?
For me it worked with moving the project directory to Users/myuser/
watchman watch-del-all them run watchman shutdown-server after finish these two command
just type npm start and accept watchman permission allow
Works for me!
Thank you man. This worked for me.
@SufianBabri Ok, if you filling good about allowing permissions which are not supposed to be allowed, that could be a solution. As for me moving the project somewhere outside of document folder is better idea.
This worked for me. Thanks
If you are using mac go to setting > Privacy & Setting > Full Disk Access > Allow Watchman and Terminals
Exactly this. For whatever reason Watchman had lost it’s permission to access my desktop/apps folder. This just allowed me to re-grant permission.
brew upgrade watchman fixed my issue
We can resolved this when we put our project outside from those folder Desktop,Download and Document then run
npm start
It will be work thanks
It didn’t work until I allowed sh to access the disk.
After a bit more research i found this issue where it has a temp fix https://github.com/facebook/watchman/issues/1030#issuecomment-1145766948
This worked for me too 😃 I tried adding access to watman executable via System Preferences but couldnt manage to do it. but this worked perfectly.
Wow this solutions worked for me great
sometime watchman is not able to access your folder where your actual project is located so for that reason it shows Operation not permitted to resolve this issue
sudo npx react-native startso it will start the serverThank you! Works for me!
Yesss!! Thanks Bro!!!
THANK YOU!
This works.
This is dumb; but it worked
No, it’s permanent. System forbid access to Documents folder. It’s security issue otherwise. Maybe there is a possibility to give a permissions, but I wouldn’t do that