在 Mac 上安装早午餐

Install brunch on Mac

我正在尝试在我的 Macbook 上安装 brunch。我输入

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

我该怎么办?

运行 具有超级用户权限的命令:

sudo npm install -g brunch

注意:这需要 root 密码。

或者您可以使用 this guide.

修复 npm 的权限