2
votes

npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path C:\Users\Avinash\AppData\Roaming\npm\node_modules\expo-cli
npm ERR! dest C:\Users\Avinash\AppData\Roaming\npm\node_modules.expo-cli-MaHHbGHy
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\Avinash\AppData\Roaming\npm\node_modules\expo-cli' -> 'C:\Users\Avinash\AppData\Roaming\npm\node_modules.expo-cli-MaHHbGHy'
npm ERR! [Error: EPERM: operation not permitted, rename 'C:\Users\Avinash\AppData\Roaming\npm\node_modules\expo-cli' -> 'C:\Users\Avinash\AppData\Roaming\npm\node_modules.expo-cli-MaHHbGHy'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\Users\Avinash\AppData\Roaming\npm\node_modules\expo-cli',
npm ERR! dest: 'C:\Users\Avinash\AppData\Roaming\npm\node_modules\.expo-cli-MaHHbGHy'
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\Avinash\AppData\Local\npm-cache_logs\2020-11-28T06_08_17_131Z-debug.log

3

3 Answers

1
votes

Please try following steps:

  1. check your antivirus status is enable or disable

  2. disable your antivirus during the installation.

I hope this helps. It worked for me.

0
votes

Open cmd as administrator , this is permission error

Also try to see if the file is in use :

https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer

https://helpcenter.gsx.com/hc/en-us/articles/115015880627-How-to-Identify-which-Windows-Process-is-Locking-a-File-or-Folder

Open Process Explorer Running as administrator. On the toolbar, find the gunsight icon on the right. Drag the icon and drop it on the open file or folder that is locked. The executable that is using the file will be highlighted in the Process Explorer main display list.

0
votes

Alongside opening your command prompt window with administrator privileges, try killing the process adb.exe, which can be found by opening your Task Manager and navigating to the Details tab. This GitHub issue has a few other possible solutions you can try.