首先需要将npm的包下载地址改为淘宝镜像地址:
npm config set registry https://npm.taobao.org/mirrors/node
下载node源码加速:
npm config set disturl https://npm.taobao.org/mirrors/node
然后将electron包下载地址注册位淘宝的镜像:
npm config set ELECTRON_MIRROR https://npm.taobao.org/mirrors/electron/