EACCES:权限被拒绝使用npm在Mac上安装NWjs

时间:2020-02-20 21:39:37

标签: node.js macos npm nwjs

当我尝试使用npm在Mac上安装NWjs时,出现以下错误。我是NWjs的新手,任何帮助将不胜感激。谢谢

EACCES: permission denied, mkdir '/usr/local/lib/node_modules/nw/nwjs'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nw@0.44.2 postinstall: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nw@0.44.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/onaapo/.npm/_logs/2020-02-21T05_26_02_243Z-debug.log

1 个答案:

答案 0 :(得分:0)

您可以尝试

sudo npm install -g [ENTER YOUR PACKAGE NAME NW OR NWJS] --unsafe-perm

注意:请注意,您是以提升用户的身份进行操作的,因此,只有在知道自己的操作之后,才能进行操作。