解决Electron安装很慢的办法

6,796 阅读1分钟

网上有很多文章介绍解决 electron 安装慢的办法,但是效果都不太好,下面给出我自己使用的办法

window系统

npm config edit

该命令会打开npm的配置文件,请在 registry=https://registry.npm.taobao.org/ 下一行添加

electron_mirror=https://cdn.npm.taobao.org/dist/electron/ 

mac系统

open .npmrc

然后再运行 npm install electron 会发现瞬间就安装好了