When I execute "npm install" I get this error
npm ERR! Error: EPERM: operation not permitted, rename C:\projects\******\node_modules\react-async-script' -> 'C:\projects\*******\node_modules\.react-async-script.DELETE'
- I am running the cmd as administrator
- I ran npm cache clean before
- I made sure all the other applications dont have anything related to node_modeules open
I had the same problem after updating to npm to 5.4.2, npm start giving the same error for most npm commands. Some solution suggest to run it with --no-optional:
it didn't work always.
other suggested to downgrade, i didn't want to downgrade.
I suspected that there was a problem with the installation, not sure what it is.
so i re-updated my npm:
and worked fine since then.
npm was failing for me at
scandir
for:...which might be caused by npm attempting to "modify" files that were potentially locked by other processes as mentioned here and in few other github threads. After force cleaning the cache, verifying cache, running as admin, disabling the AV, etc the solution that actually worked for me was closing any thing that might be placing a lock the files (i.e. restarting my computer).
I hope this helps someone struggling.
For some, AppRoot\npm folder could be an issue. Sometimes the AppRoot folder is marked as network shared and thus Antivirus blocks the stuff. Follow below link for complete solution.
https://alastaircrabtree.com/fixing-intermittant-eperm-operation-not-permitted-on-npm-install/
I hope this helps.
I was getting the same thing. I didn't find this anywhere but it hit me that our VMs tend to change files to a read-only state. So I opened
package.json
's file properties and deselectedRead-only
in the "General" tab.Steps
package.json
file.I had the same problem. The reason for the error is unsupported characters in the path to the file. Replaced the cyrillic in English - it helped.
My answer is to do
npm cache clean --force
first. Then runnpm install -g npm@5.3.0
to install npm 5.3.0 version. for me, this npm version works with no trouble.