0

im trying to build react-native app. running the commands on gitBash, windows10. when im trying to run 'npm start' im getting this error: Fixed , just installed again expo-cli in the rn-starter folder, thanks for the answers :)

$ npm start
> @ start C:\Users\Liran\food
> expo start
'expo-cli' is not recognized as an internal or external command,
operable program or batch file.
This command requires Expo CLI.
Do you want to install it globally [Y/n]? Y
Installing the package 'expo-cli'...
npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path C:\Users\Liran\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\Liran\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll'
npm ERR!  [OperationalError: EPERM: operation not permitted, unlink 'C:\Users\Liran\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, unlink 'C:\Users\Liran\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'unlink',
npm ERR!     path: 'C:\\Users\\Liran\\AppData\\Roaming\\npm\\node_modules\\expo-cli\\node_modules\\@expo\\.xdl.DELETE\\binaries\\windows\\adb\\AdbWinApi.dll'
npm ERR!   },
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path: 'C:\\Users\\Liran\\AppData\\Roaming\\npm\\node_modules\\expo-cli\\node_modules\\@expo\\.xdl.DELETE\\binaries\\windows\\adb\\AdbWinApi.dll',
npm ERR!   parent: '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\Liran\AppData\Roaming\npm-cache\_logs\2020-10-19T09_36_58_255Z-debug.log
Installing Expo CLI failed. You can install it manually with:
  npm install --global expo-cli
npm ERR! code ELIFECYCLE
npm ERR! errno 4294963248
npm ERR! @ start: `expo start`
npm ERR! Exit status 4294963248
npm ERR!
npm ERR! Failed at the @ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Liran\AppData\Roaming\npm-cache\_logs\2020-10-19T09_36_58_348Z-debug.log

help please someone :)

Liran.B
  • 1
  • 5

2 Answers2

0

Open windows terminal as Administrator and run command:

install --global expo-cli

then from the root of your project you can either run expo start or npm start both will do.

CodeGeek
  • 119
  • 5
  • Expo cli isn't installing simply because your adb is still using the previously installed expo cli on your system, kill the process adb.exe from TaskManager or try the same after restarting your system. – CodeGeek Oct 19 '20 at 12:06
0

You need to install Expo CLI package.

see: https://docs.expo.io/workflow/expo-cli/

install:

npm install -g expo-cli

If you still getting same error do these two steps;

  1. Be sure about working on terminal as administrator
  2. If you're using an antivirus program, STOP it while trying to execute above command.
hakki
  • 6,181
  • 6
  • 62
  • 106
  • open your terminal as administrator and try again. I think it's a permission issue. If you look your error log It says something about permissions. – hakki Oct 19 '20 at 11:11
  • see this: https://www.howtogeek.com/194041/how-to-open-the-command-prompt-as-administrator-in-windows-8.1/#:~:text=Press%20Windows%2BR%20to%20open,Command%20Prompt%20window%20as%20administrator. – hakki Oct 19 '20 at 11:13
  • If you're using an anti-virus program, STOP it. (see: https://stackoverflow.com/a/56853520/1848929) @Liran.B – hakki Oct 19 '20 at 11:14