搜尋

首頁  >  問答  >  主體

node.js - mac 安装hexo,提示npm WARN checkPermissions Missing write access

   输入 $ npm install -g hexo

提示错误:

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/hexo
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
/usr/local/lib
└── hexo@3.2.0 

npm ERR! Darwin 15.2.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "hexo"
npm ERR! node v5.9.0
npm ERR! npm  v3.7.3
npm ERR! path /usr/local/lib/node_modules/hexo
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/hexo'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules/hexo']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules/hexo' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/jason/npm-debug.log
PHP中文网PHP中文网2784 天前619

全部回覆(3)我來回復

  • PHP中文网

    PHP中文网2017-04-17 13:59:49

    npm說是,最好不要用root來執行,否則會很麻煩,請參考這個解決方法

    回覆
    0
  • 巴扎黑

    巴扎黑2017-04-17 13:59:49

    請切換到root使用者執行

    回覆
    0
  • 高洛峰

    高洛峰2017-04-17 13:59:49

    $ sudo npm install -g hero-cli
    輸入上面指令安裝就行了

    回覆
    0
  • 取消回覆