Reputation: 482
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).
Upvotes: 14
Views: 11324
Reputation: 1795
Here are the steps
Open Task Manager - right-click on the task bar and select it, or from the screen when you Ctrl-Alt-Delete. If you have the standard Task Manager, click to expand More details. (If you're using something like Process Explorer, you're probably comfortable finding your own way.)
In the Background processes click on adb.exe (32 bit) (or, presumably, something similar). Click End task or press Delete to kill the process. This should unlock the problematic files.
This is probably not necessary - I deleted the folder that contained the files that caused the error in the first place, .xdl-DELETE. (I would expect npm to do it for me but I was testing my hypothesis 😉.) Remember to close any command prompts or Explorer windows afterwards, because otherwise you'll be locking the expo-cli folder. (I'd left an Explorer window open in that folder which is why I mention it 🤦♂️.)
Run npm i -g expo-cli to update. You'll have time to make a cup of tea while it's going, so I suggest doing that.
Upvotes: 0
Reputation: 1094
The steps I followed (May this follow help you.)
It worked for me, good luck.
Upvotes: 2
Reputation: 393
More Simple Solution For Windows 10 Close The Android Emulator.
And restart the system and run npm install -g expo-cli
Upvotes: 2
Reputation: 287
Go to your task manager and kill the process of Adb.exe and boom.
Upvotes: 3
Reputation: 694
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
Upvotes: 52