在尝试安装electron@2.0.18时遇到了错误,错误代码为ELIFECYCLE,安装过程在postinstall阶段失败。日志文件位于C:Users**AppDataRoamingpm-cache_logs?1-04-16T10_06_44_239Z-debug.log。建议通过设置npm配置,将electron的镜像源更改为淘宝镜像源来解决此问题:npm config set electron_mirror https://npm.taobao.org/mirrors/electron/ npm install。
npm ERR! A complete log of this run can be found in: npm ERR! C:Users**AppDataRoaming pm-cache_logs?1-04-16T10_06_44_239Z-debug.log
报错信息
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@2.0.18 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron@2.0.18 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! C:Users**AppDataRoaming
pm-cache_logs?1-04-16T10_06_44_239Z-debug.log
解决办法
npm config set electron_mirror "https://npm.taobao.org/mirrors/electron/"npm install