报错信息
Downloading tmp-20148-0-electron-v6.1.7-win32-x64.zip
Error: read ECONNRESET
C:\Users\22751\AppData\Roaming\npm\node_modules\electron\install.js:53
throw err
^
Error: read ECONNRESET
at TLSWrap.onread (net.js:622:25)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@6.1.7 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron@6.1.7 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\22751\AppData\Roaming\npm-cache\_logs\2019-12-31T07_14_25_326Z-debug.log
解决办法
修改.npmrc文件里的内容,修改之后保存再安装就可以了,修改如下
registry=https://registry.npm.taobao.org /*如果你已经切换至淘宝源,那么这行在你编辑文件前就已经存在*/
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
phantomjs_cdnurl=http://npm.taobao.org/mirrors/phantomjs
ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/
.npmrc一般在你的用户目录下,找到之后修改一下即可