安装 CLI( Grunt 命令行)时出错,请帮忙看一下

2015-01-17 17:13:45 +08:00
 huangyang

按照 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

请大湿指点迷津。

4451 次点击
所在节点    问与答
6 条回复
wwwap
2015-01-17 17:15:35 +08:00
sudo !!
sunjourney
2015-01-17 18:14:56 +08:00
官方是这么教你的嘛?
anti9take
2015-01-17 18:35:01 +08:00
npm ERR! Please try running this command again as root/Administrator.
......
FrankFang128
2015-01-17 18:41:20 +08:00
不懂英文还学啥 NodeJS
dofine
2015-01-17 18:49:51 +08:00
sudo ...
我一个纯外行都能看懂。
huangyang
2015-01-17 20:58:56 +08:00
多谢各位

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/163013

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX