Reputation: 11
I'm trying to install expo but it shows me this message
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/expo-cli
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/expo-cli'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/expo-cli'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/expo-cli'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
I had expo installed before and I was trying to start an app over, so I am sure I may have touched something I shouldn't have. I'm a newbie, so any help would be appreciated!
Tried to uninstall VSC, but to no avail. I'm a bit stuck!
Upvotes: 0
Views: 645
Reputation: 944202
You appear to be trying to install globally, but you are not using a system administrator account so you don't have permission to do that.
The documentation says that to start an app you should:
npx create-expo-app --template
The other commands in the documentation also use npx
, including the CLI:
npx expo
npx
won't try to install things globally, and is the recommended way to install and run applications from npm.
Presumably you are following some other documentation which is predates npx
and is trying to install globally. Don't do that. Use the modern approach.
Upvotes: 0