Error with npm install #7884 - npm WARN locking Error: EACCES - npm

trying npm install on concat-map i get this error i already tried adding sudo
npm install concat-map
npm WARN locking Error: EACCES, open '/Users/mercadotecnia/.npm/_locks/concat-map-a127112b4f6ee84c.lock'
npm WARN locking /Users/mercadotecnia/.npm/_locks/concat-map-a127112b4f6ee84c.lock failed { [Error: EACCES, open '/Users/mercadotecnia/.npm/_locks/concat-map-a127112b4f6ee84c.lock']
npm WARN locking errno: 3,
npm WARN locking code: 'EACCES',
npm WARN locking path: '/Users/mercadotecnia/.npm/_locks/concat-map-a127112b4f6ee84c.lock' }
npm ERR! Darwin 11.4.2
npm ERR! argv "node" "/usr/local/bin/npm" "install" "concat-map"
npm ERR! node v0.10.35
npm ERR! npm v2.7.0
npm ERR! Attempt to unlock /Users/mercadotecnia/Desktop/Sitios/bill/node_modules/concat-map, which hasn't been locked
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <http://github.com/npm/npm/issues>

in terminal, do the following
$ sudo chown -R $(whoami) "$HOME/.npm"

Related

Installing bower is throwing errors

I can't seem to install bower properly. I don't know what's wrong, but it keeps throwing these errors. Can someone help?
npm ERR! tar.unpack untar error /Users/Jeanwoo/.npm/bower/1.4.1/package.tgz
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! node v0.12.5
npm ERR! npm v2.11.2
npm ERR! path /usr/local/lib/node_modules/bower
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/bower'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/bower']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/bower',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/bower',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53',
npm ERR! 'FSReqWrap.oncomplete (fs.js:95:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Jeanwoo/npm-debug.log
I'm assuming the command you're running is npm install -g bower (to install Bower globally on your machine).
The error
Please try running this command again as root/Administrator
...makes me think you should try running as root:
sudo npm install -g bower
And then input your password and it should install. If not, what is the command you're running?

Error when I run "npm install -g yo bower grunt-cli gulp" command line

I get this error when I run the command "npm install -g yo bower grunt-cli gulp".
Does any one know what the problem is?
npm ERR! tar.unpack untar error /Users/??????/.npm/grunt-cli/0.1.13/package.tgz
npm ERR! tar.unpack untar error /Users/??????/.npm/yo/1.4.7/package.tgz
npm ERR! tar.unpack untar error /Users/??????/.npm/gulp/3.9.0/package.tgz
npm ERR! tar.unpack untar error /Users/??????/.npm/bower/1.4.1/package.tgz
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "yo" "bower" "grunt-cli"
"gulp"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! path /usr/local/lib/node_modules/grunt-cli
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/grunt-cli'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/grunt-cli']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/grunt-cli',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/grunt-cli',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53',
npm ERR! 'FSReqWrap.oncomplete (fs.js:95:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/??????/npm-debug.log
As Vohuman pointed out, running this as sudo would fix it. You're trying to install the packages globally which requires access to /usr/local which you don't have write privileges to, so as the error message says, please try running this command again as root/Administrator.
Even "logged in" as root (sudo su) [ On CentOS ]
sudo npm install -g ...
Otherwise was still executing as user, possibly the directory owner?

npm not installing bower on OSX 10.10.1

Anybody know how to fix this?
/Users/foo $npm install -g bower
npm http request GET https://registry.npmjs.org/bower
npm http 200 https://registry.npmjs.org/bower
npm http fetch GET https://registry.npmjs.org/bower/-/bower-1.3.12.tgz
npm http fetch 200 https://registry.npmjs.org/bower/-/bower-1.3.12.tgz
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! path /Users/foo/.node/bin/bower
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! Error: EACCES, unlink '/Users/foo/.node/bin/bower'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, unlink '/Users/foo/.node/bin/bower'
npm ERR! errno: -13,
npm ERR! code: 'EACCES'
npm ERR! path: '/Users/foo/.node/bin/bower' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES, unlink'/Users/foo/.node/bin/bower'
npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: EACCES, unlink '/Users/foo/.node/bin/bower']
npm ERR! error rolling back errno: -13,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/Users/foo/.node/bin/bower' }
``
npm ERR! Please include the following file with any support request:
npm ERR! /Users/foo/npm-debug.log
/Users/foo$echo $PATH
/Users/foo/.npm:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/mysql/bin
:/opt/X11/bin:/usr/local/share/npm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
Have you tried running it as Root user? try
sudo npm install -g bower
The npm ERR! code EACCES usually results because it didn't have permission to access a necessary folder or file

NPM local install tried to write ~/.npm folder which got EACCESS error

I tried to add the 'method-override' package to my current Express project. I ran below command, and got error.
qinguo$ npm install method-override --save
npm WARN package.json redis-url#0.2.0 No repository field.
npm ERR! Error: EACCES, mkdir '/Users/qinguo/.npm/parseurl/1.1.3'
npm ERR! { [Error: EACCES, mkdir '/Users/qinguo/.npm/parseurl/1.1.3']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/qinguo/.npm/parseurl/1.1.3',
npm ERR! parent: 'method-override' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "method-override" "--save"
npm ERR! cwd /Users/qinguo/allcodes/gitebay/NewX/sh-go
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.5.0-alpha-3
npm ERR! path /Users/qinguo/.npm/parseurl/1.1.3
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/Users/qinguo/.npm/parseurl/1.1.3'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/qinguo/allcodes/gitebay/NewX/sh-go/npm-debug.log
npm ERR! not ok code 0
I tried to update npm, re-install, it didn't work.
Try running as sudo -
npm install method-override --save
My guess is that root owns some of the packages in npm's cache. You can check by running:
ls -l ~/.npm
Check if the package causing the error is not owned by your user.
If some of the packages are owned by root, you should chown the ~/.npm folder to your current user.
sudo chown -R `whoami` ~/.npm
Read more: npm cache

Bower installation on a vagrant machine

I am trying to install bower on a vagrant machine using following command
npm install -g bower
but i am getting following error
npm WARN prefer global bower#1.3.2 should be installed with -g
npm http GET https://registry.npmjs.org/bower
npm http 200 https://registry.npmjs.org/bower
[4mRunning "watch" task[24m
Waiting...npm http GET https://registry.npmjs.org/bower/-/bower-1.3.2.tgz
npm http 200 https://registry.npmjs.org/bower/-/bower-1.3.2.tgz
npm ERR! Error: EACCES, mkdir '/usr/lib/node_modules/bower'
npm ERR! { [Error: EACCES, mkdir '/usr/lib/node_modules/bower']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/lib/node_modules/bower',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/lib/node_modules/bower',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR! '/usr/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53',
npm ERR! 'Object.oncomplete (fs.js:107:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.2.0-23-generic-pae
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "bower" "--no-bin-links"
npm ERR! cwd /vagrant
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! path /usr/lib/node_modules/bower
npm ERR! fstream_path /usr/lib/node_modules/bower
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/lib/node_modules/bower'
npm ERR! fstream_stack /usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /vagrant/npm-debug.log
npm ERR! not ok code 0
/tmp/vagrant-shell: line 44: bower: command not found
It seems that bower is not simplly gets installed on a windows machine.
Please help in issue.
Any help will be appericiated.
You need root access for global install.
sudo npm install -g bower