简体   繁体   English

电子安装中止-ECONNRESET

[英]Electron installing abort - ECONNRESET

I'm trying to install electron via npm and I get this error : 我正在尝试通过npm安装电子,但出现此错误: 在此处输入图片说明 How can I solve it? 我该如何解决?

You can set custom mirrors to download electron from a seperate mirror. 您可以设置自定义反射镜以从单独的反射镜下载电子。 Just add this before npm install , or inside the hooks somewhere. 只需在npm install之前或在钩子内的某个位置添加它即可。

ELECTRON_MIRROR="https://npm.taobao.org/mirrors/electron/"

I've always used this because github were extremely slow for electron release downloads even on the servers. 我一直使用它,因为github甚至在服务器上的电子版本下载都非常慢。

Might be a bad internet connection or a proxy issue. 可能是互联网连接不良或代理问题。 You may want to try to remove your proxy: 您可能要尝试删除代理:

npm config rm proxy
npm config rm https-proxy

It's better to install electron globally. 最好在全球范围内安装electron You can try npm i electron -g --verbose also update your npm before install electron npm i -g npm 您可以尝试使用npm i electron -g --verbose –verbose在安装electronic npm i -g npm之前也更新您的npm i -g npm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM