想要安装个n
,npm install -g n
,报错
npm http GET http://npm.hacknodejs.com/n
npm http 404 http://npm.hacknodejs.com/n
npm ERR! registry error parsing json
npm ERR! Error: EACCES, mkdir '/usr/lib/node_modules'
npm ERR! { [Error: EACCES, mkdir '/usr/lib/node_modules']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/lib/node_modules',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/lib/node_modules/n',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/lib/nodejs/npm/node_modules/fstream/lib/writer.js:171:23',
npm ERR! '/usr/lib/nodejs/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 Linux 3.8.0-19-generic
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "n"
npm ERR! cwd /home/shukri
npm ERR! node -v v0.10.12
npm ERR! npm -v 1.2.32
npm ERR! path /usr/lib/node_modules
npm ERR! fstream_path /usr/lib/node_modules/n
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'
npm ERR! fstream_stack /usr/lib/nodejs/npm/node_modules/fstream/lib/writer.js:171:23
npm ERR! fstream_stack /usr/lib/nodejs/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! /home/shukri/npm-debug.log
npm ERR! not ok code 0
然后 sudo npm install -g n
,但是输入密码之后就没有反应了
然后试着’npm -v’
1.2.32
然后 sudo npm -v
,命令行又什么都没输出,也没反应。。。
系统是linuxmint15
,刚装的系统,应该没问题啊