I am a newbie in all this stuff. Hope for your understanding.
Let me clarify the issue:
I am trying to start react native app through expo cli. So tried to start npm install expo-cli --global
to install npm globally. I got these errors:
It also says that I lack permissions to access it. How can I allow permissions? Even when I try to start it locally I got the same issue. Your help is appreciated.
You did not mention which os. This answer working for any operating system (ubuntu in my case)
I'm also getting permission errors when running
sudo npm install --global expo-cli
Which I don't really how this can happen - as this also happens for the superuser!
For me it works when I install the client locally into the project
cd <new-project-dir>
npm init # init npm project
npm install expo-cli
Now you can use the client in this project like this:
npx expo-cli # e.g. npx expo-cli init <project-name>
although this solution is not the best and the safest solution exists, this worked for me and that make sense because all the problem we had with the errors is the permission problems. so you can use this command and ignore those permission problems :
sudo npm install expo-cli -g --unsafe-perm
I was having the same problem with npm install -g expo-cli, having "MODULE_NOT_FOUND",
I installed yarm with brew, just in case you do not already have it:
brew install yarn
and then use:
yarn global add expo-cli
to create a project you can:
expo init nameOfTheNewProject
and choose a template in the console. Finally run the project with
yarn start
Let me know if it works for you!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With