huangyang
V2EX  ›  问与答

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

  •  
  •   huangyang · Jan 17, 2015 · 5145 views
    This topic created in 4208 days ago, the information mentioned may be changed or developed.

    按照 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 replies    2015-01-17 20:58:56 +08:00
    wwwap
        1
    wwwap  
       Jan 17, 2015
    sudo !!
    sunjourney
        2
    sunjourney  
       Jan 17, 2015
    官方是这么教你的嘛?
    anti9take
        3
    anti9take  
       Jan 17, 2015
    npm ERR! Please try running this command again as root/Administrator.
    ......
    FrankFang128
        4
    FrankFang128  
       Jan 17, 2015
    不懂英文还学啥 NodeJS
    dofine
        5
    dofine  
       Jan 17, 2015
    sudo ...
    我一个纯外行都能看懂。
    huangyang
        6
    huangyang  
    OP
       Jan 17, 2015
    多谢各位
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5627 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 06:46 · PVG 14:46 · LAX 23:46 · JFK 02:46
    ♥ Do have faith in what you're doing.