Some NPM installations do not work with EPERM 50 (Gulp and others)

I keep getting permission errors in Windows 7 when I try to install some modules on npm. For example, a global gulp installation results in the following:

 c: \ Users \ abc \ Documents \ uniform \ UniServer \ www \ ur> npm install -g gulp /> v8flags@1.0.1 install C: \ Users \ abc \ AppData \ Roaming \ npm \ node_modules \ gulp \ node_modules \ v8flags> node fetch.js flags for v8 3.14.5.9 cached.  npm ERR!  Error: EPERM, open 'C: \ Users \ abc \ Documents \ uniform \ UniServer \ www \ npmcache \ c14291c8-cheansan-regex-0-2-1-package-tgz.lock' npm ERR!  {[Error: EPERM, open 'C: \ Users \ abc \ Documents \ uniform \ UniServer \ www \ npmcache \ c14291c8- che-ansi-regex-0-2-1-package-tgz.lock'] npm ERR!  errno: 50, npm ERR!  code: 'EPERM', npm ERR!  path: 'C: \\ Users \\ abc \\ Documents \\ uniform \\ UniServer \\ www \\ npmcache \\ c14291c8-che-ans i-regex-0-2-1-package-tgz.lock'} npm ERR!  npm ERR!  Please try running this command again as root / Administrator.  npm ERR!  System Windows_NT 6.1.7601 npm ERR!  command "C: \\ Program Files \\ nodejs \\\\ node.exe" "C: \\ Program Files \\ nodejs \\ node_modules \\ n pm \\ bin \\ npm-cli.js" "install" "-g" "gulp" npm ERR!  cwd c: \ Users \ abc \ Documents \ uniform \ UniServer \ www \ ur npm ERR!  node -v v0.10.32 npm ERR!  npm -v 1.4.28 npm ERR!  path C: \ Users \ abc \ Documents \ uniform \ UniServer \ www \ npmcache \ c14291c8-che-ansi-regex-0-2-1-package-tgz.lock npm ERR!  code EPERM npm ERR!  errno 50 npm ERR!  stack Error: EPERM, open 'C: \ Users \ abc \ Documents \ uniform \ UniServer \ www \ npmcache \ c14291c 8-che-ansi-regex-0-2-1-package-tgz.lock' npm ERR!  not ok code 0 

I get this error when cmd starts as administrator. I read in other posts that this could mean a missing program. git installed and working, so it is not. bower installed and working. I tried adding c:\windows\system32 to the PATH system. There is no help. As you can tell, I changed the location of my NPM cache, thinking that perhaps the folder in which it was by default had some permissions. There is no help. I tried adding the -no-bin-links option, it doesn't help. I am really at a loss as to what causes this problem. Have the same problem trying to install slush-mongo , either globally or locally.

+6
source share
3 answers

It turns out that in fact it caused the antivirus software of our company. We tried to make exceptions from node.exe and our working directory, but both were insufficient. We must disable the AV software, complete the installation, and then turn on the AV again.

+4
source

I had the same problem and found these command line flags that seemed to fix it without disconnecting AV:

 npm install --cache-lock-retries 1000 --cache-lock-wait 100000 

You can change the default values ​​(so you do not need to add command line options every time):

 npm config set cache-lock-retries 1000 npm config set cache-lock-wait 100000 
+5
source

I had the same problem that I was able to solve by opening a command prompt or GIT Bash using the RUN AS ADMINISTRATOR OPTION command.

STEP 1: right click on cmd.exe (find cmd in windows) or GIT Bash.

STEP 2: Click "Run as administrator".

STEP 3: execute the npm install command

0
source

Source: https://habr.com/ru/post/977718/


All Articles