nodeschool / western-mass

Western Massachusetts Nodeschool Chapter
0 stars 1 forks source link

Error installing learnyounode using npm #29

Closed a-pasquale closed 8 years ago

a-pasquale commented 9 years ago

This is a common problem when installing learnyounode or other npm modules:

$ npm install -g learnyounode
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "learnyounode"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! path /usr/local/lib/node_modules/learnyounode
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, rmdir '/usr/local/lib/node_modules/learnyounode'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES, rmdir '/usr/local/lib/node_modules/learnyounode']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/usr/local/lib/node_modules/learnyounode' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES, rmdir '/usr/local/lib/node_modules/learnyounode'
npm ERR! error rolling back     at Error (native)
npm ERR! error rolling back  { [Error: EACCES, rmdir '/usr/local/lib/node_modules/learnyounode']

To resolve this issue, you should run the command with root permissions:

$ sudo npm install -g learnyounode

This lets the files be installed into the system path so that the commands can be run anywhere on the filesystem.