Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Certain NPM installs fail with EPERM 50 (Gulp and others)

I continue to get permissions errors on Windows 7 when trying to npm install certain modules. A global install of gulp for example results in this:

c:\Users\abc\Documents\uniform\UniServer\www\ur>npm install -g gulp
/
> [email protected] 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-che-
ansi-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 while running cmd as administrator. I've read in other SO posts that this may represent a missing program. git is installed and works so it's not that. bower is installed and works. I've tried adding c:\windows\system32 to the system PATH. No help. As you may be able to tell, I modified the location of my NPM cache thinking that perhaps the folder it was in by default had some sort of permissions issue. No help there either. I've tried adding the --no-bin-links option, doesn't help. I'm really at a loss as to what is causing this problem. Have the same issue trying to install slush-mongo, either globally or locally.

like image 720
Matt Molnar Avatar asked Nov 04 '14 16:11

Matt Molnar


1 Answers

I had the same problem and found these command-line flags that seem to fix it without having to disable AV:

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

You can change the default values (so you don't need to add the command-line options every time) by running:

npm config set cache-lock-retries 1000
npm config set cache-lock-wait 100000
like image 159
arolson101 Avatar answered Sep 28 '22 02:09

arolson101