按照 Grunt 官方文档安装 GLI 出错,错误信息如下:
jiang:~ bici_new$ npm install -g grunt-cli
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/grunt-cli'
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/grunt-cli']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/grunt-cli',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/grunt-cli',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR! '/usr/local/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 Darwin 14.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "grunt-cli"
npm ERR! cwd /Users/bici_new
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR! path /usr/local/lib/node_modules/grunt-cli
npm ERR! fstream_path /usr/local/lib/node_modules/grunt-cli
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/local/lib/node_modules/grunt-cli'
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/local/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! /Users/bici_new/npm-debug.log
npm ERR! not ok code 0
请大湿指点迷津。
1
wwwap 2015-01-17 17:15:35 +08:00
sudo !!
|
2
sunjourney 2015-01-17 18:14:56 +08:00
官方是这么教你的嘛?
|
3
anti9take 2015-01-17 18:35:01 +08:00
npm ERR! Please try running this command again as root/Administrator.
...... |
4
FrankFang128 2015-01-17 18:41:20 +08:00
不懂英文还学啥 NodeJS
|
5
dofine 2015-01-17 18:49:51 +08:00
sudo ...
我一个纯外行都能看懂。 |
6
huangyang OP 多谢各位
|