permission denied on npm install -g expo-cli

hi,
I’m trying to update my expo client to version 34.0.0 and I saw that i’m supposed to run again npm install -g expo-cli. However, I’m getting an error:

npm ERR! path C:\Users\Yarden\AppData\Roaming\npm\node_modules\expo-cli\node_modules@expo.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink ‘C:\Users\Yarden\AppData\Roaming\npm\node_modules\expo-cli\node_modules@expo.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll’
npm ERR! { [Error: EPERM: operation not permitted, unlink ‘C:\Users\Yarden\AppData\Roaming\npm\node_modules\expo-cli\node_modules@expo.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll’]
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, unlink ‘C:\Users\Yarden\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:
npm ERR! ‘C:\Users\Yarden\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll’ },
npm ERR! stack:
npm ERR! ‘Error: EPERM: operation not permitted, unlink 'C:\Users\Yarden\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:
npm ERR! ‘C:\Users\Yarden\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! 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).

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Yarden\AppData\Roaming\npm-cache_logs\2019-08-28T13_31_31_467Z-debug.log

I have tried using administrator mode with no success.
Any ideas?
Thank you!!

Have you got any other programs open that were using it? It does say towards the end of the output that the operation was rejected by your operating system. Worth rebooting (to make sure all the locks are gone) and trying again?

Otherwise run the cmd window in Administrator mode?

nothing was opened and I ran it in administrator mode. It was solved by running yarn install expo-cli.

Thank you for your help!

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.