(node:21368) UnhandledPromiseRejectionWarning: RequestError: connect ETIMEDOUT
如果你想我一样, 上网需要经过一个代理, npm install electron -g的时候, npm设置的proxy不能生效,导致安装出错。
解决办法是:
set ELECTRON_GET_USE_PROXY=代理
因为electron的安装中用到一个自己的下载程序, 而那个下载程序不会从npm中继承代理设置。
npm config set ELECTRON_MIRROR https://npm.taobao.org/mirrors/electron/