0

I'm new in react-native, I'm trying to set up my project after all package install when I tried to start npm start command then show me 'expo-cli' is not recognized as an internal or external command, this error.

ok, then I have followed the guide from here

after that I have added my env path in this way:

environment variable >  System Variables > PATH >
C:\Users\YOUR_USERNAME\AppData\Roaming\npm

then I have to install again:

npm install -g expo-cli

but it does not work for me, I don't know why.

when I try to run this command npm install -g expo-cli then show me an error like this:

PS C:\Users\alami\OneDrive\Desktop\React native\starter-react-native> npm install -g expo-cli
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\Program Files\nodejs\node_modules\expo-cli
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\expo-cli'     
npm ERR!  [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\expo-cli'] {
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: 'C:\\Program Files\\nodejs\\node_modules\\expo-cli'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
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.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\alami\AppData\Local\npm-cache\_logs\2021-05-21T00_58_34_585Z-debug.log
Alamin
  • 1,878
  • 1
  • 14
  • 34

1 Answers1

0

At least I just solved my problem in this way:

  1. Search cmd
  2. Then run as administrator
  3. Then npm i -g expo-cli

I just solved my problem.

Alamin
  • 1,878
  • 1
  • 14
  • 34