问答详情
源自:3-1 创建Electron工程

安装electron时报错

Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/electron/.electron'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@6.0.1 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron@6.0.1 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/cuiyuejiao/.npm/_logs/2019-08-11T08_35_43_504Z-debug.log



4204 error code ELIFECYCLE
4205 error errno 1
4206 error electron@6.0.1 postinstall: `node install.js`
4206 error Exit status 1
4207 error Failed at the electron@6.0.1 postinstall script.
4207 error This is probably not a problem with npm. There is likely additional logging output above.
4208 verbose exit [ 1, true ]

提问者:Jessy_CYJ 2019-08-11 16:38

个回答

  • 神思者
    2019-08-11 22:15:42

    苹果系统在安装命令前面加上sudo

  • Jessy_CYJ
    2019-08-11 23:03:25

    加上sudo也是这样