Npm install angular/cli error EPERM Operation not permitted

15,273

Solution 1

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

Solution 2

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

Solution 3

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.

Solution 4

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

Share:
15,273

Related videos on Youtube

devendra
Author by

devendra

Updated on June 04, 2022

Comments

  • devendra
    devendra almost 2 years

    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 ]

    • xan_z
      xan_z over 5 years
      Permission issue - launch the command promt as a admin - right click on your cmd.exe and run as administrator and try .
    • Elliot Blackburn
      Elliot Blackburn over 5 years
      Hi @devendra, welcome to StackOverflow. It's worth reading the "How can I write a good question?" guide seen here (stackoverflow.com/help/how-to-ask). Your question here provides the error which is good, but there's a lot more information you could provide to make it easier to get to an answer. Checkout the guide for more info.
    • devendra
      devendra over 5 years
      hey, i am launching cmd as admin but still get the issue.
  • devendra
    devendra over 5 years
    thanks selem, i always open command prompt and select the "run as administrator" and then run "npm i -g @angular/cli". i tried many times npm clean cache --force or uninstall node, delete npm-cache and npm folder and then reinstall node but no success.
  • devendra
    devendra over 5 years
    i tried many times by deleting folder npm and npm cache, uninstall node and then reinstall but that doesn't fix my problem. i am installing the stable version of node v8.12.0 and npm 6.4.1
  • Sunith Saga
    Sunith Saga over 4 years
    Are you running you node app behind any corporate proxy?