安装Electron时报如下错误:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@16.0.5 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron@16.0.5 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

如图所示:

alt:npm ERR! electron@16.0.5 postinstall: node install.js

解决方法:将electron下载地址指向taobao镜像即可。

npm config set electron_mirror "https://npm.taobao.org/mirrors/electron/"