Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install -g expo-cli fails with "EPERM: operation not permitted, unlink '...\adb.exe'

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).

like image 241
Griseld Gerveni Avatar asked May 17 '19 21:05

Griseld Gerveni


4 Answers

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

like image 104
Frankrnz Avatar answered Oct 27 '22 00:10

Frankrnz


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.

like image 40
sami ullah Avatar answered Sep 30 '22 23:09

sami ullah


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

like image 3
Subhojit Ghosh Avatar answered Oct 27 '22 00:10

Subhojit Ghosh


More Simple Solution For Windows 10 Close The Android Emulator.

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

like image 2
Vinoth Smart Avatar answered Oct 26 '22 22:10

Vinoth Smart