NPM installation issues on Mac OS Mavericks - node.js

I am trying to get to grips with AngularJS, NodeJS and Ruby on Rails. When trying to install npm packages like yeoman, grunt etc. I receive an error in my Terminal which I have listed below:
npm ERR! Error: EACCES, open '/Users/Jabane/.npm/glob/3.2.11/package/package.json.25961'
npm ERR! { [Error: EACCES, open '/Users/Jabane/.npm/glob/3.2.11/package/package.json.25961']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/Jabane/.npm/glob/3.2.11/package/package.json.25961',
npm ERR! parent: 'browserify' }
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" "browserify"
npm ERR! cwd /Users/Jabane
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.16
npm ERR! path /Users/Jabane/.npm/glob/3.2.11/package/package.json.25961
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/Users/Jabane/.npm/glob/3.2.11/package/package.json.25961'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/kJabane/npm-debug.log
npm ERR! not ok code 0
What might be the issue in this case? Your assistance is highly appreciated.
Thanks

This is a permissions issue. You need to prefix your npm install command with sudo, e.g.:
sudo npm install yeoman
It will prompt you for your User Account's password; and subject to the correct password being provided, will then install the packages correctly.

Related

How do I install the latest npm version on my shared server through SSH

I have been trying to update the npm on the shared hosting server (linux) through SSH using this command: npm i npm#latest -g
I keep getting this error message:
npm ERR! Linux 3.10.0-714.10.2.lve1.4.66.el6h.x86_64
npm ERR! argv "node" "/usr/bin/npm" "i" "npm#latest" "-g"
npm ERR! node v0.10.47
npm ERR! npm v3.8.3
npm ERR! path /usr/lib/node_modules/npm/node_modules/abbrev
npm ERR! code EACCES
npm ERR! Error: EACCES, access '/usr/lib/node_modules/npm/node_modules/abbrev'
npm ERR! at module.exports (/usr/lib/node_modules/npm/lib/install/access-error.js:4:18)
npm ERR! at /usr/lib/node_modules/npm/lib/install/writable.js:30:25
npm ERR! at /usr/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:232:16
npm ERR! at Object.oncomplete (fs.js:108:15)
npm ERR! { [Error: EACCES, access '/usr/lib/node_modules/npm/node_modules/abbrev']
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/lib/node_modules/npm/node_modules/abbrev' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
I have tried to follow this advice,
chown -R $USER /usr/local
but no success.
Any advice is welcome

Appium_npm install -g appium please try running this command again as root/Administrator

Am trying to install appium in ubuntu and got the below error.I searched so many articles and installed node through linuxbrew and even changed the permission also but still getting the below error.Can any one help please
npm ERR! tar.unpack untar error /home/ubuntu/.npm/appium/1.3.6/package.tgz
npm ERR! Linux 3.13.0-44-generic
npm ERR! argv "node" "/home/ubuntu/.linuxbrew/bin/npm" "install" "-g" "appium"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! path /home/ubuntu/lib/node_modules/appium
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! Error: EACCES, mkdir '/home/ubuntu/lib/node_modules/appium'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, mkdir '/home/ubuntu/lib/node_modules/appium']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/home/ubuntu/lib/node_modules/appium',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/home/ubuntu/lib/node_modules/appium',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/home/ubuntu/.linuxbrew/lib/node_modules/npm/node_modules
/fstream/lib/dir-writer.js:36:23',
npm ERR! '/home/ubuntu/.linuxbrew/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53',
npm ERR! 'FSReqWrap.oncomplete (fs.js:99: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! /home/ubuntu/npm-debug.log
I have tried npm cache clean also but still not working.
What does linuxbrew doctor return?
Try to bash reset.sh --hardcore to completely reset Appium server and all npm modules

Unable to run telescope / meteor

Im trying to follow the instructions from http://www.telesc.pe/docs/installing-telescope/
Managed to install node.js and npm using the link on the page. I have also installed meteor and meteorite. I have also pulled the latest update using git clone git#github.com:TelescopeJS/Telescope.git
I can can run another meteor app. (like a demo 'myapp')
But when I try and launch meteor from inside the 'telescope' folder, I get the following:
*Last login: Fri Aug 1 19:52:52 on ttys000
static-239:~ shwaytaj$ cd telescope
static-239:telescope shwaytaj$ meteor
[[[[[ ~/telescope ]]]]]
=> Started proxy.
=> Started MongoDB.
iron-router: updating npm dependencies -- connect...
npm ERR! Error: EACCES, open '/Users/shwaytaj/.npm/inherits/2.0.1/package/package.json'
npm ERR! { [Error: EACCES, open '/Users/shwaytaj/.npm/inherits/2.0.1/package/package.json']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/shwaytaj/.npm/inherits/2.0.1/package/package.json',
npm ERR! parent: 'readable-stream' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.0.0
npm ERR! command "/Users/shwaytaj/.meteor/tools/cef2bcd356/bin/node" "/Users/shwaytaj/.meteor/tools/cef2bcd356/bin/npm" "install" "connect#2.9.0"
npm ERR! cwd /Users/shwaytaj/.meteorite/packages/iron-router/EventedMind/iron-router/05415a8891ea87a00fb1e2388585f2ca5a38e0da/.npm/package-new-1efnvtc
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /Users/shwaytaj/.npm/inherits/2.0.1/package/package.json
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/Users/shwaytaj/.npm/inherits/2.0.1/package/package.json'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/shwaytaj/.meteorite/packages/iron-router/EventedMind/iron-router/05415a8891ea87a00fb1e2388585f2ca5a38e0da/.npm/package-new-1efnvtc/npm-debug.log
npm ERR! not ok code 0
mailchimp: updating npm dependencies -- mailchimp...
npm ERR! Error: EACCES, mkdir '/Users/shwaytaj/.npm/request/2.39.0'
npm ERR! { [Error: EACCES, mkdir '/Users/shwaytaj/.npm/request/2.39.0']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/shwaytaj/.npm/request/2.39.0',
npm ERR! parent: 'mailchimp' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.0.0
npm ERR! command "/Users/shwaytaj/.meteor/tools/cef2bcd356/bin/node" "/Users/shwaytaj/.meteor/tools/cef2bcd356/bin/npm" "install" "mailchimp#1.0.3"
npm ERR! cwd /Users/shwaytaj/telescope/packages/mailchimp/.npm/package-new-55uyws
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /Users/shwaytaj/.npm/request/2.39.0
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/Users/shwaytaj/.npm/request/2.39.0'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/shwaytaj/telescope/packages/mailchimp/.npm/package-new-55uyws/npm-debug.log
npm ERR! not ok code 0
fast-render: updating npm dependencies -- connect...
npm ERR! Error: EACCES, open '/Users/shwaytaj/.npm/inherits/2.0.1/package/package.json'
npm ERR! { [Error: EACCES, open '/Users/shwaytaj/.npm/inherits/2.0.1/package/package.json']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/shwaytaj/.npm/inherits/2.0.1/package/package.json',
npm ERR! parent: 'readable-stream' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.0.0
npm ERR! command "/Users/shwaytaj/.meteor/tools/cef2bcd356/bin/node" "/Users/shwaytaj/.meteor/tools/cef2bcd356/bin/npm" "install" "connect#2.13.0"
npm ERR! cwd /Users/shwaytaj/.meteorite/packages/fast-render/arunoda/meteor-fast-render/149984b1aff3a5642a270aff9bd9006872c8302e/.npm/package-new-1c6pww9
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /Users/shwaytaj/.npm/inherits/2.0.1/package/package.json
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/Users/shwaytaj/.npm/inherits/2.0.1/package/package.json'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/shwaytaj/.meteorite/packages/fast-render/arunoda/meteor-fast-render/149984b1aff3a5642a270aff9bd9006872c8302e/.npm/package-new-1c6pww9/npm-debug.log
npm ERR! not ok code 0
=> Errors prevented startup:
While building package `iron-router`:
error: couldn't install npm package
While building package `mailchimp`:
error: couldn't install npm package
While building package `fast-render`:
error: couldn't install npm package
=> Your application has errors. Waiting for file change.*
Seems like you were using sudo too much. Make sure that you're the owner of all files within ~/.npm and ~/.meteorite, so basically
sudo chown -R username:username ~/.npm ~/.meteorite
You're probably getting this because you did:
sudo npm install -g meteorite
If you do sudo mrt in the teloscope app folder it will probably run fine.
If you want to resolve the issue you will need to fix your permissions, you can do:
sudo chown -R whoami ~/.npm
See here for more:
https://github.com/oortcloud/meteorite/

Error while installing express using npm

I already have installed express using
npm install express
but looks like in order too create apps I should install it globally. So I used:
npm install -g express
but received:
npm ERR! Error: EACCES, mkdir '/usr/lib/node_modules/express'
npm ERR! { [Error: EACCES, mkdir '/usr/lib/node_modules/express']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/lib/node_modules/express',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/lib/node_modules/express',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/lib/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR! '/usr/lib/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.11.2-201.fc19.x86_64
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "express"
npm ERR! cwd /home/parisa
npm ERR! node -v v0.10.19
npm ERR! npm -v 1.3.6
npm ERR! path /usr/lib/node_modules/express
npm ERR! fstream_path /usr/lib/node_modules/express
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/express'
npm ERR! fstream_stack /usr/lib/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/lib/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! /home/parisa/npm-debug.log
npm ERR! not ok code 0
then after trying sudo:
sudo npm install -g express
I get this:
axconfig: unable to open axports file /etc/ax25/axports (No such file or directory)
why is that???
As the error clearly states, you don't have permissions to create in /usr/lib.
stack Error: EACCES, mkdir '/usr/lib/node_modules/express'
hence install with sudo permissions..
sudo npm install -g express
Are you using fedora?
At least in fedora the "node" package is not node.js, It is an amateur radio utility,
axconfig is a file of that software.
npm is not finding nodejs, it is trying to use the wrong software.
Install nodejs package
sudo yum install nodejs
and remove node package
sudo yum remove node
Now npm must work properly for the super user.
edit: Also in debian repositories, the package 'node' is not nodejs
If you are on Arch Linux, check out the npm2arch package in the AUR. It will let you install npm packages using pacman.
Example:
npm2archinstall express

"sudo npm install -g grunt-cli" gives me an error

I get an error when trying to install gruntjs on a linux 12.04 (with a mirrored packages source)
Here is the error:
sudo npm install -g grunt-cli
npm ERR! Error: ENOENT, open '/home/havetl/.npm/d63f3d0b-grunt-cli.lock'
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 Linux 3.5.0-23-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "grunt-cli"
npm ERR! cwd /home/havetl
npm ERR! node -v v0.10.18
npm ERR! npm -v 1.3.8
npm ERR! path /home/havetl/.npm/d63f3d0b-grunt-cli.lock
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! Error: EACCES, open 'npm-debug.log'
npm ERR! { [Error: EACCES, open 'npm-debug.log'] errno: 3, code: 'EACCES', path: 'npm-debug.log' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.5.0-23-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "grunt-cli"
npm ERR! cwd /home/havetl
npm ERR! node -v v0.10.18
npm ERR! npm -v 1.3.8
npm ERR! path npm-debug.log
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open 'npm-debug.log'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/havetl/npm-debug.log
npm ERR! not ok code 0
Thanks for any idea!
According to the maintainer of npm, installing packages with sudo is considered bad practice because you are allowing that package to have complete control of your system and you can't and SHOULDN'T trust these packages with root access. Think Debian's long release cycles as an extreme example of protecting end users from community maintained packages for this exact reason.
http://howtonode.org/introduction-to-npm
You should do what Issaacs suggests and chown your /usr/local folder so you have RW permissions.
I've had this problem before; sometimes for global packages your current working directory has to be ~/ (but I'm not sure why this is!). Try:
cd ~/; sudo npm install -g grunt-cli
This blog worked for me :
http://slopjong.de/2012/10/31/how-to-install-the-latest-nodejs-in-ubuntu/
the error was because in ubuntu v12 few of the dependencies were not available for the latest version of Node.

Resources