0

I am learning Node js through nodeschool. I install different package but once i upgrade the version of NPM. I am unable to install package. I am getting this error.

npm ERR! Error: EACCES, mkdir '/usr/lib/node_modules/scope-chains-closures' npm ERR! { [Error: EACCES, mkdir '/usr/lib/node_modules/scope-chains-closures'] npm ERR! errno: 3, npm ERR! code: 'EACCES', npm ERR! path: '/usr/lib/node_modules/scope-chains-closures', npm ERR! fstream_type: 'Directory', npm ERR! fstream_path: '/usr/lib/node_modules/scope-chains-closures', 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:46:53', npm ERR! 'Object.oncomplete (fs.js:108:15)' ] } npm ERR! npm ERR! Please try running this command again as root/Administrator. npm ERR! System Linux 3.13.0-53-generic npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "scope-chains-closures" npm ERR! cwd /home/pjain/workspace/Node npm ERR! node -v v0.10.38 npm ERR! npm -v 1.4.28 npm ERR! path /usr/lib/node_modules/scope-chains-closures npm ERR! fstream_path /usr/lib/node_modules/scope-chains-closures 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/scope-chains-closures' 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:46:53 npm ERR! fstream_stack Object.oncomplete (fs.js:108:15) npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/pjain/workspace/Node/npm-debug.log 
4
  • 1
    What's your question? Seems like you don't have permission to access /usr/lib/node_modules/scope-chains-closures. Did you try what is suggested in the error message? Commented Jun 8, 2015 at 7:30
  • 1
    use sudo to run as an admin Commented Jun 8, 2015 at 7:30
  • check the 14th line in your log: npm ERR! Please try running this command again as root/Administrator. Commented Jun 8, 2015 at 7:45
  • for CodeSchool you are probably using a Linux server in the cloud somewhere. On Mac and Linux boxes, you will need to use sudo frequently to run npm commands, get used to it :) Commented Jun 8, 2015 at 8:03

1 Answer 1

2

Try running your npm command as:

sudo npm install <package-name> 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.