devendra
devendra

Reputation: 31

Npm install angular/cli error EPERM Operation not permitted

4399 error Error: EPERM: operation not permitted, unlink 'C:\Users\deven\AppData\Roaming\npm\node_modules.staging\tmp-5fcc012e\README.md' 4399 error { Error: EPERM: operation not permitted, unlink 'C:\Users\deven\AppData\Roaming\npm\node_modules.staging\tmp-5fcc012e\README.md' 4399 error cause: 4399 error { Error: EPERM: operation not permitted, unlink 'C:\Users\deven\AppData\Roaming\npm\node_modules.staging\tmp-5fcc012e\README.md' 4399 error errno: -4048, 4399 error code: 'EPERM', 4399 error syscall: 'unlink', 4399 error path: 'C:\Users\deven\AppData\Roaming\npm\node_modules\.staging\tmp-5fcc012e\README.md' }, 4399 error stack: 'Error: EPERM: operation not permitted, unlink \'C:\Users\deven\AppData\Roaming\npm\node_modules\.staging\tmp-5fcc012e\README.md\'', 4399 error errno: -4048, 4399 error code: 'EPERM', 4399 error
syscall: 'unlink', 4399 error path: 'C:\Users\deven\AppData\Roaming\npm\node_modules\.staging\tmp-5fcc012e\README.md', 4399 error parent: '@angular/cli' } 4400 error The operation was rejected by your operating system. 4400 error It's possible that the file was already in use (by a text editor or antivirus), 4400 error or that you lack permissions to access it. 4400 error 4400 error If you believe this might be a permissions issue, please double-check the 4400 error permissions of the file and its containing directories, or try running 4400 error the command again as root/Administrator (though this is not recommended). 4401 verbose exit [ -4048, true ]

Upvotes: 2

Views: 19158

Answers (9)

Donald
Donald

Reputation: 21

Okay, for me running as the administrator did not work at all. Nothing worked until I went into my root/global folder as shown below:

C:\Users\MyName

and in that folder I deleted the node_modules folder and any Angular config files that were globally put there. After doining that I went back to my local folder and it worked perfectly.

I hope this helps.

Upvotes: 0

Panchakshari Puranmatt
Panchakshari Puranmatt

Reputation: 333

I had opened the project in multiple terminals. Later after closing all the respective terminals and running 'npm i', things started to work well.

Upvotes: -1

Ariye Caspi
Ariye Caspi

Reputation: 76

It solved for me when I made this: Right-click on -What ever program I use- and select Run as Administrator. Personally I made it on PowerShell, but I assume that it works this way on any program

Upvotes: 1

Sai Teja
Sai Teja

Reputation: 1

Please try following steps:

  1. Delete node_modules
  2. Do npm cache clean --force
  3. Restart the PC
  4. Try again npm install, now modules will install without any issues

(optional) - If you are behind VPN and not using any private registry , exit VPN and do npm install after restarting pc

Upvotes: 0

monnaung
monnaung

Reputation: 1

  1. Launch your code editor (eg.. Visual Studio Code) as Administrator.
  2. npm install -g @vue/cli.
  3. vue create yourprojectname.

Upvotes: 0

Chathuran D
Chathuran D

Reputation: 2430

Try to uninstall the CLI using:

npm uninstall -g @angular/cli

and reinstall using:

npm install -g @angular/cli

and also try to update npm to latest version

npm cache clean --force

npm install -g npm@latest

Upvotes: 1

shanti
shanti

Reputation: 367

It may be possible that your package.json is open in some editor. Close it and then run the npm command again.

Upvotes: 1

ca1c
ca1c

Reputation: 1295

It seems like this is a problem with npm. Try deleting your node_modules folder and running npm install again. This should fix the problem.

Upvotes: 1

SeleM
SeleM

Reputation: 9638

Since you're using Windows, you have to launch the terminal as administrator and retry should work.

Upvotes: 9

Related Questions