11
votes

I receive an error when running

$ npm install -g expo-cli

I have tried reinstalling the node modules as An Administrator but the same error occurs.

Environment: Windows 10, Node Version: 10.15.3, NPM Version: 6.9.0

I expect the install to happen but an error like this occurs:

npm ERR! path C:\Users\Griseld\AppData\Roaming\npm\node_modules\expo-cli\node_modules.xdl.DELETE\binaries\windows\adb\adb.exe npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall unlink npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\Griseld\AppData\Roaming\npm\node_modules\expo-cli\node_modules.xdl.DELETE\binaries\windows\adb\adb.exe' npm ERR! { [Error: EPERM: operation not permitted, unlink 'C:\Users\Griseld\AppData\Roaming\npm\node_modules\expo-cli\node_modules.xdl.DELETE\binaries\windows\adb\adb.exe'] npm ERR! cause: npm ERR! { Error: EPERM: operation not permitted, unlink 'C:\Users\Griseld\AppData\Roaming\npm\node_modules\expo-cli\node_modules.xdl.DELETE\binaries\windows\adb\adb.exe' npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR!
syscall: 'unlink', npm ERR! path: npm ERR!
'C:\Users\Griseld\AppData\Roaming\npm\node_modules\expo-cli\node_modules\.xdl.DELETE\binaries\windows\adb\adb.exe' }, npm ERR! stack: npm ERR! 'Error: EPERM: operation not permitted, unlink \'C:\Users\Griseld\AppData\Roaming\npm\node_modules\expo-cli\node_modules\.xdl.DELETE\binaries\windows\adb\adb.exe\'', npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'unlink', npm ERR! path: npm ERR!
'C:\Users\Griseld\AppData\Roaming\npm\node_modules\expo-cli\node_modules\.xdl.DELETE\binaries\windows\adb\adb.exe', npm ERR! parent: 'expo-cli' } 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 (though this is not recommended).

6
Are you running an android emulator or connecting the device when you install it?hong developer
android emulatorGriseld Gerveni
When you install, try installing without running any programs related to Android.hong developer

6 Answers

46
votes

Go through this line from your error log, it says 'C:\Users\Griseld\AppData\Roaming\npm\node_modules\expo-cli\node_modules.xdl.DELETE\binaries\windows\adb\adb.exe' npm ERR!

the expo cli wasn't installing simply because your adb is still using the previously installed expo cli on your system. had similar issue not quite long...kill the process adb.exe

3
votes

Go to your task manager and kill the process of Adb.exe and boom.

2
votes

More Simple Solution For Windows 10 Close The Android Emulator.

And restart the system and run npm install -g expo-cli

2
votes

The steps I followed (May this follow help you.)

  1. npm uninstall -g expo-cli (If already have installed any version on your machine)
  2. npm clear cache --force
  3. Killed Abd.exe from Task Manager
  4. npm uninstall -g expo-cli

It worked for me, good luck.

0
votes

In my case, stopping the webpack server did the job.

0
votes

Simply deleting "android/app/build" fixed it for me.