V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
huangyang
V2EX  ›  问与答

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

  •  
  •   huangyang · 2015-01-17 17:13:45 +08:00 · 4451 次点击
    这是一个创建于 3625 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    请大湿指点迷津。

    6 条回复    2015-01-17 20:58:56 +08:00
    wwwap
        1
    wwwap  
       2015-01-17 17:15:35 +08:00
    sudo !!
    sunjourney
        2
    sunjourney  
       2015-01-17 18:14:56 +08:00
    官方是这么教你的嘛?
    anti9take
        3
    anti9take  
       2015-01-17 18:35:01 +08:00
    npm ERR! Please try running this command again as root/Administrator.
    ......
    FrankFang128
        4
    FrankFang128  
       2015-01-17 18:41:20 +08:00
    不懂英文还学啥 NodeJS
    dofine
        5
    dofine  
       2015-01-17 18:49:51 +08:00
    sudo ...
    我一个纯外行都能看懂。
    huangyang
        6
    huangyang  
    OP
       2015-01-17 20:58:56 +08:00
    多谢各位
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2616 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 05:07 · PVG 13:07 · LAX 21:07 · JFK 00:07
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.