在使用npm安装Electron的过程,可能会碰到一直卡在下载安装包的过程中。这时可能会先想到切换到淘宝的镜像下载,会发现也没有效果。例如下面这种情况。
$ npm i -D electron@latest
> electron@4.0.6 postinstall /tmp/node_modules/electron
> node install.js
Downloading tmp-46341-0-electron-v4.0.6-darwin-x64.zip
[> ] 0.0% (0 B/s)
^C
$ npm i -D electron@latest --registry=https://registry.npm.taobao.org
> electron@4.0.6 postinst