'Read-only file system error when try to install pod on macbook m1

I'm trying to install react-native app on ios emulator but i have an error say it have no podlock, so i find solution here No `Podfile' found in the project directory

but i ran into a problem when i try to pod install in ios folder, it show like this

enter image description here

Please help, i'm totally new to mac, i never using mac before, thank a lots



Solution 1:[1]

I solved, it turns out this folder is read-only, don't know why but it was a document folder, I move the project to the top level of the document, like document/project, and it works, but place project in document/a/b/c/project it not work, so weird, still looking for an answer.

Solution 2:[2]

There are some Libraries that break with pods with arm-64 MacBook pro's. I have faced the same issues while setting up with React-Native. You can duplicate your terminal and enable the open with the Rosseta option. This option will run the pods using the Rosetta emulation. There are still many libraries that break on the new MacBook Pro.

You can follow this link for adding a duplicate terminal that uses Rosetta: Adding Rosseta Terminal

Solution 3:[3]

I fixed it by running pod install with the parameter --project-direcotry=~/<path-to-my-project> like this:

pod install --project-directory=~/<path-to-my-project>

Also, if you need to run npx install-expo-modules, could be achive by it:

npx install-expo-modules ~/<path-to-my-project>

Apparently, the simple fact to set relative path solved it ;)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 abdul sathar
Solution 2 Saahiil
Solution 3 dhanielo