NPM installation issues on Mac OS Mavericks

2019-08-07 01:50发布

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

1条回答
戒情不戒烟
2楼-- · 2019-08-07 02:14

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.

查看更多
登录 后发表回答