在Mac上安装早午餐

时间:2016-08-28 20:26:56

标签: macos npm brunch

我试图在我的Macbook上安装早午餐。我输入

npm install -g brunch

并最终输出

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "brunch"
npm ERR! node v6.4.0
npm ERR! npm  v3.10.3
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!     at Error (native)
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!     at Error (native)
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
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/aryaman.arora/npm-debug.log

我该怎么办?

1 个答案:

答案 0 :(得分:2)

使用超级用户权限运行命令:

sudo npm install -g brunch

注意:这需要root密码。

或者您可以使用this guide修复npm的权限。