Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operation not permitted #977

Closed
QSJSI opened this issue Nov 26, 2021 · 59 comments
Closed

Operation not permitted #977

QSJSI opened this issue Nov 26, 2021 · 59 comments

Comments

@QSJSI
Copy link

QSJSI commented Nov 26, 2021

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)

@Desintegrator
Copy link

Hi. You should move the entire project directory outside of the Documents directory

@QSJSI
Copy link
Author

QSJSI commented Nov 26, 2021

Hi. You should move the entire project directory outside of the Documents directory

Worked for me!! kudos man!!

@khazaddoom
Copy link

Hi. You should move the entire project directory outside of the Documents directory

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.

@ccamisoss
Copy link

For me it worked with moving the project directory to Users/myuser/

@BruceSuperProgramer
Copy link

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/

@brabus786
Copy link

Просто перенес в корень, и то-же сработало

@robbporto
Copy link

Is there a permanent fix for this? Moving my project to another folder is not a fix.

@Desintegrator
Copy link

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

@TwanLuttik
Copy link

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

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?

@TwanLuttik
Copy link

So i have factory reseted my macbook and i still have the same issue where i have to put it into users/${name}/ folder.

@TwanLuttik
Copy link

After a bit more research i found this issue where it has a temp fix #1030 (comment)

@legion-zver
Copy link

It didn't work until I allowed sh to access the disk.

@AlexChaseJones
Copy link

Hi. You should move the entire project directory outside of the Documents directory

This is dumb; but it worked

@hamzafer
Copy link

Not sure why, but using iTerm instead of Terminal solved the issue for me.

@MzkZeeshan
Copy link

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

@Xidiyixiwocao
Copy link

Hi. You should move the entire project directory outside of the Documents directory

work for me . thanks

@Xidiyixiwocao
Copy link

Hi. You should move the entire project directory outside of the Documents directory

May I ask how do you think out this solution, cause it really bother me a lot

@SufianBabri
Copy link

I had my project inside Documents folder too and was receiving the same error as the OP when I ran npx react-native start

As mentioned by someone else, it happens due to macOS making Documents directory private by default.

To fix the issue, I did the following:

  1. Run sudo npx react-native start
  2. When asked if you want to give your terminal app access to Documents folder, allow it.
  3. Now you will see that it is working as expected. It means that you can quit the command with Ctrl + C.
  4. From now on you can (and preferably should) use npx react-native start

Hope it helps others.

@Desintegrator
Copy link

Desintegrator commented Jul 6, 2022

@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.

@mushtaque87
Copy link

brew upgrade watchman fixed my issue

@rishiankush
Copy link

First run watchman watch-del-all
then run watchman shutdown-server fixed my issue

@freirepaulo
Copy link

perfect bro! this is the real fix!!

@fcamargo10
Copy link

First run watchman watch-del-all
then run watchman shutdown-server fixed my issue

FIXED!

@Ade-Joshe
Copy link

First run watchman watch-del-all then run watchman shutdown-server fixed my issue

This works.

@cctv1005s
Copy link

First run watchman watch-del-all then run watchman shutdown-server fixed my issue

Works for me!

@OPvishal
Copy link

OPvishal commented Dec 3, 2022

Hi. You should move the entire project directory outside of the Documents directory

thanks man, by the way how did u find it?

@OswalDev
Copy link

OswalDev commented Dec 8, 2022

Hi. You should move the entire project directory outside of the Documents directory

This worked perfectly for me, thank you.

@efe3535
Copy link

efe3535 commented Jan 27, 2023

Privacy & Security -> Files and Folders
image

@ol4juwon
Copy link

ol4juwon commented Feb 5, 2023

First run watchman watch-del-all then run watchman shutdown-server fixed my issue

this worked for me. thanks.

@QSJSI QSJSI closed this as completed Feb 6, 2023
@bkamrani
Copy link

bkamrani commented Feb 20, 2023

Hi. You should move the entire project directory outside of the Documents directory

Move the project directory outside the Documents directory was the solution for me (watchman watch-del-all + watchman shutdown-server was not effective in my case).

@zhangfuchao
Copy link

Privacy & Security -> Files and Folders image

Thank you! Works for me!

@useCallback
Copy link

First run watchman watch-del-all then run watchman shutdown-server fixed my issue

works perfectly 🚀

@namti
Copy link

namti commented Mar 31, 2023

Running sudo npm run start fixes it. It will ask full disk access

@kashifansari786
Copy link

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

  1. run sudo npx react-native start so it will start the server
  2. when the server is started, a popup appears that allows access to the folder for watchman allows it.
  3. then run your project in Android/IOS it will run as expected.

@Aakash359
Copy link

First run watchman watch-del-all then run watchman shutdown-server fixed my issue

Wow this solutions worked for me great

@Hoang-Phong-2122
Copy link

First run watchman watch-del-all then run watchman shutdown-server fixed my issue

THANK YOU!

@KalanaPallemulla
Copy link

Privacy & Security -> Files and Folders image

Thank you man. This worked for me.

@ovieimara
Copy link

First run watchman watch-del-all then run watchman shutdown-server fixed my issue
worked for me. Thanks.

@deepbag
Copy link

deepbag commented May 6, 2023

If you are using mac go to setting > Privacy & Setting > Full Disk Access > Allow Watchman and Terminals

@anisjonischkeit
Copy link

On my mac, the fix was System Preferences > Privacy Settings > Files and Folders > watchman [x]Documents Folder

@kingingcole
Copy link

First run watchman watch-del-all then run watchman shutdown-server fixed my issue

The perfect fix!

@BaseMax
Copy link

BaseMax commented Jul 18, 2023

Hi. You should move the entire project directory outside of the Documents directory

You saved my time. I moved the project from Downloads dir to somewhere else.

Thanks

@erickcrus
Copy link

First run watchman watch-del-all then run watchman shutdown-server fixed my issue

I love you!

@deivyrene
Copy link

First run watchman watch-del-all then run watchman shutdown-server fixed my issue

A majestic solution!

@Dr-Wrong-Mo
Copy link

First run watchman watch-del-all then run watchman shutdown-server fixed my issue

Thanks for this!

@peterng014
Copy link

Privacy & Security -> Files and Folders
image

this is the root cause for me, wondering why having a lot of watchman instances there

@sholleyonline
Copy link

First run watchman watch-del-all then run watchman shutdown-server fixed my issue

This worked for me. Thanks

@muhammadqazi
Copy link

First run watchman watch-del-all then run watchman shutdown-server fixed my issue

Thanks, worked for me.

@1pretom
Copy link

1pretom commented Dec 15, 2023

First run watchman watch-del-all then run watchman shutdown-server fixed my issue

this worked to me, tks

@hmadJutt
Copy link

hmadJutt commented Feb 2, 2024

This is easiest fix
https://stackoverflow.com/a/74032225

@hakansaglam29
Copy link

Hi. You should move the entire project directory outside of the Documents directory

why?

@Desintegrator
Copy link

Hi. You should move the entire project directory outside of the Documents directory

Cause Documents folder has some permission restrictions for security reasons by default

@usmanabid94
Copy link

watchman shutdown-server

Bro you saved me I updated homebrew and suddenly this issue came but your solution worked as a savior.

@9589589661
Copy link

My project work when i move my project outside from desktop,downlaod and document folder.

@RomanDivkovic
Copy link

First run watchman watch-del-all then run watchman shutdown-server fixed my issue

Works great thanks, no need to move the project for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests