转载:https://blog.csdn.net/mirkey2code/article/details/131636739
网上部分会让你修改electron的镜像地址
npm config set ELECTRON_MIRROR http://npmmirror.com/mirrors/electron/
但是我用ps会提示
npm ERR! `ELECTRON_MIRROR` is not a valid npm option
npm ERR! A complete log of this run can be found in:C:\Users\<用户名>......
可以进配置文件里改试试
npm config ls
这个是地址
进文件添加一行
ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/