Samarth Asthana
Samarth Asthana

Reputation: 1

Error while installing expo-cli with npm and yarn

I don't know whats's wrong with my system I am trying to setup expo-cli with yarn global add expo-cli the expo init projectname doesn't work and its getting me same problem when I am trying to install with sudo npm install expo-cli --global?

This is the problem with yarn https://i.sstatic.net/q518S.png & This is the problem with npm https://i.sstatic.net/ojF0h.png

Upvotes: 0

Views: 874

Answers (2)

Wojciech Kozyra
Wojciech Kozyra

Reputation: 500

yarn install worked but directory where yarn puts executables for packages is not added to your PATH. If you add it there it should work.

If you want to go with npm, I would strongly recommend to never run npm install with sudo. Use tools like nvm or volta. It will install node, npm and all other packages in your home directory, it should solve all issues with permissions without giving access to your entire system.

https://github.com/nvm-sh/nvm

Upvotes: 1

Redseb
Redseb

Reputation: 329

Try avoiding the global npm install with npx expo-cli

Alternatively, try sudo npm install -g --unsafe-perm expo-cli to install the package globally through root. This seems to be a common error with Ubuntu, more information can be found here: https://github.com/expo/expo-cli/issues/591

Upvotes: 0

Related Questions