Avinash gupta
Avinash gupta

Reputation: 211

Error: “The operation was rejected by your operating system” when trying to update expo-cli

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

Upvotes: 2

Views: 8447

Answers (5)

M. Izudinov
M. Izudinov

Reputation: 21

Check if you have explorer or some folder open. Closing that folder/explorer solved my problem

Upvotes: 0

Melky Choti
Melky Choti

Reputation: 1

I found it was because I had the folder open in my code editor. Closed it and ran the npm install command and it worked.

Upvotes: 0

Alex Rummel
Alex Rummel

Reputation: 152

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.

Upvotes: 0

pratiksha chavan
pratiksha chavan

Reputation: 96

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.

Upvotes: 1

PDHide
PDHide

Reputation: 19939

Open cmd as administrator , this is permission error

Also try to see if the file is in use :

https://learn.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.

Upvotes: 0

Related Questions