Npm ERR! code EPERM

I get this error when running Visual Studio Code because the typescript compiler watches files and locks them (see https://github.com/Microsoft/vscode/issues/28593). The solution is to temporarily close VS Code when dealing with NPM. Perhaps you have something watching files?


I'm having the same problem, even using Node v8.6.0 and npm v5.4.2.

Solved with:

npm cache clean --force

&

npm install [package] --force

Reference: npm wiki's troubleshooting guide.


Are you using any private or company registry. check your .npmrc file and make sure its available.

if you are in company environment, make sure proxy is not a problem.

check in your folder if any package-lock.json is generated. you can delete that make re install.

I have little doubt but node 6.x.x with npm 5.x.x might be a problem as node 7.x.x is compatible arable with 5.x.x. And normally node 6.x.x is compatible with npm 4.x.x