I've been working on this for a while and it's the simplest thing....I NEED to simply install express so I can move on and actually work. No matter what I do I get this same error and Express won't install:
~ npm install -g express
npm WARN checkPermissions Missing write access to /Users/revjtanton/.nvm/versions/node/v0.12.2/lib/node_modules/express
/Users/revjtanton/.nvm/versions/node/v0.12.2/lib
└── express#4.14.0
npm ERR! Darwin 15.6.0
npm ERR! argv "node" "/Users/revjtanton/.nvm/versions/node/v0.12.2/bin/npm" "install" "-g" "express"
npm ERR! node v0.12.2
npm ERR! npm v3.9.3
npm ERR! path /Users/revjtanton/.nvm/versions/node/v0.12.2/lib/node_modules/express
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! Error: EACCES, access '/Users/revjtanton/.nvm/versions/node/v0.12.2/lib/node_modules/express'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, access '/Users/revjtanton/.nvm/versions/node/v0.12.2/lib/node_modules/express']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/revjtanton/.nvm/versions/node/v0.12.2/lib/node_modules/express' }
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/revjtanton/npm-debug.log
I've managed permissions, cleaned caches, tried installing with sudo (which doesn't produce an error...but I'm still not able to use express).
Execute the command with sudo:
sudo npm install -g express
I'm trying to install PhantomJS 2 for a project that requires support for mutation observers. When I use the following command:
npm install phantomjs2 --save-dev
I get the following error:
Unexpected platform or architecture: win32 x64
npm ERR! phantomjs2#2.0.0 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs2#2.0.0 install script.
npm ERR! This is most likely a problem with the phantomjs2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls phantomjs2
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodej
s\\node_modules\\npm\\bin\\npm-cli.js" "install" "phantomjs2" "--save-dev"
npm ERR! cwd g:\Web\GitHub\pet
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! g:\Web\GitHub\pet\npm-debug.log
npm ERR! not ok code 0
I am using 64 bit Windows 7. Is PhantomJS 2 just not supported on my platform?
Yes, that package currently doesn't support installing PhantomJS 2 on Windows. Just download it from the official page and put the exe in a directory that is in the PATH.
Attempting to install Yeoman on my mac, I first tried following command from the documentation...
npm install -g yo
Got an error:
npm ERR! Please try running this command again as root/Administrator.
I tried again with:
sudo npm install -g yo
but it fails half-way through. This is the feedback where it fails and it repeats this pattern for a lot of failed packages.
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/glob/.travis.yml'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "yo"
npm ERR! cwd /Users/vivid
npm ERR! node -v v0.10.7
npm ERR! npm -v 1.2.21
npm ERR! path /usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/glob/.travis.yml
npm ERR! fstream_path /usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/glob/.travis.yml
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
Any thoughts?
I ran into the same problem. What fixed it for me was simply logging in as root first, using:
$ su
Next, installing Yeoman worked like a charm:
$ npm install -g yo
The big difference is the logging in as root using su, instead of sudo.
Now I have installed Node and Npm and I run this command in terminal (yes I am on a mac):
npm install -g bower
Which follows with this output from the terminal:
npm http GET https://registry.npmjs.org/bower
npm http 304 https://registry.npmjs.org/bower
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/bower'
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/bower']
npm ERR! errno: 3,
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:36:23',
npm ERR! '/usr/local/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 Darwin 13.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! cwd /Users/Superfunnytogo
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! path /usr/local/lib/node_modules/bower
npm ERR! fstream_path /usr/local/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/local/lib/node_modules/bower'
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/local/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! /Users/Superfunnytogo/npm-debug.log
npm ERR! not ok code 0
Device-365-352:~ Superfunnytogo$ npm install -g bower
npm http GET https://registry.npmjs.org/bower
npm http 304 https://registry.npmjs.org/bower
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/bower'
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/bower']
npm ERR! errno: 3,
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:36:23',
npm ERR! '/usr/local/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 Darwin 13.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! cwd /Users/Superfunnytogo
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! path /usr/local/lib/node_modules/bower
npm ERR! fstream_path /usr/local/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/local/lib/node_modules/bower'
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/local/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! /Users/Superfunnytogo/npm-debug.log
npm ERR! not ok code 0
You need root access or permissions to install globally! Try :
sudo npm install -g bower
Much better than using sudo is setting a user level prefix. For example in ~/.npmrc set:
prefix = ${HOME}/npm-global
to use this folder for packages installed with -g.
Then you also need to set your PATH environment variable to include ${HOME}/npm-global/bin.
you shouldn't sudo bower right? I mean sudo npm install -g bower will work BUT here's the message I got:
Additional error details:
Since bower is a user command, there is no need to execute it with superuser permissions.
If you're having permission errors when using bower without sudo, please spend a few minutes learning more about how your system should work and make any necessary repairs.
http://www.joyent.com/blog/installing-node-and-npm
https://gist.github.com/isaacs/579814
You can however run a command with sudo using --allow-root option
If you've installed node/npm via Homebrew on OSX you may want to first run brew doctor and follow instructions before sudo-ing any system folders. In my case this brought up a nag about agreeing to an Xcode/iOS license:
Builds will fail! Agree to the license by opening Xcode.app or running:
xcodebuild -license
After doing that and running a brew update I was able to install Bower globally as expected.
I know that it's an old thread but I run into the issue recently after reinstalling Yosemite and xCode tools. In case anyone else gets stuck, what helped me was using the commands:
sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config
Following suggestion from the thread below:
https://github.com/bower/bower/issues/2262
Using sudo with npm is discouraged.
Look here https://stackoverflow.com/a/18277225/1857521 for a better solution to an almost identical problem.
I get the Following on imac when install grunt
sudo npm install grunt-cli -g
npm http GET https://registry.npmjs.org/grunt-cli
npm http 304 https://registry.npmjs.org/grunt-cli
npm ERR! TypeError: uid must be an int
npm ERR! at Object.fs.chown (fs.js:840:11)
npm ERR! at Object.chown (/usr/local/lib/node_modules/npm/node_modules/graceful- fs/polyfills.js:131:17)
npm ERR! at endChown (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:212:12)
npm ERR! at setProps (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:295:5)
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:286:7
npm ERR! at Object.oncomplete (fs.js:94:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Darwin 12.4.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "grunt-cli" "-g"
npm ERR! cwd /usr
npm ERR! node -v v0.11.5-pre
npm ERR! npm -v 1.3.4
Please Help me figure out what I am doing wrong here thanks!
Solved it by using version 0.10.13.