解决
打开终端,输入vim ~/.npmrc,在里面添加一行:
electron_mirror=https://cdn.npm.taobao.org/dist/electron/
然后再试一次安装就可以了。
参考
https://www.jianshu.com/p/28a0305ac187
https://www.cnblogs.com/tadx2/p/12259235.html(windows下的安装)
http://www.electronjs.org/docs/tutorial/installation