打开 cmd,输入 npm config edit 打开 .npmrc 文件
文件顶部设置 registry=xxx 下增加一行:electron_mirror=https://cdn.npm.taobao.org/dist/electron/
;;;; ; npm userconfig file ; this is a simple ini-formatted file ; lines that start with semi-colons are comments. ; read `npm help config` for help on the various options ;;;; registry=https://mirrors.huaweicloud.com/repository/npm/ electron_mirror=https://cdn.npm.taobao.org/dist/electron/ //registry.npmjs.org/:_authToken=5fa01e51-cf4c-49c0-98da-f1bbc6247213 ;;;;
参考链接:https://juejin.cn/post/6855526489904349198