解决方法
- 使用正确的镜像源
npm config set registry https://registry.npmmirror.com
然后执行以下代码
清除一下缓存,并删除掉node_module
npm cache clean –force
切换cnpm安装
npm config set registry https://registry.npmmirror.com
安装electron
cnpm i electron –save-d
出现

安装成功!
npm config set registry https://registry.npmmirror.com
然后执行以下代码
清除一下缓存,并删除掉node_module
npm cache clean –force
切换cnpm安装
npm config set registry https://registry.npmmirror.com
安装electron
cnpm i electron –save-d
出现
安装成功!