electron-builder部署及下载慢解决方法
最近工作需要用到electron及用electron-builder打包,发现electron,electron-builder下载都比较慢。下面是解决方法
安装node.js
首先需要安装node.js,可以在nodejs官网获取安装包
设置npm为华为云镜像
npm config set registry https://mirrors.huaweicloud.com/repository/npm/
npm cache clean -f
设置浏览器引擎驱动镜像地址
npm config set chromedriver_cdnurl https://mirrors.huaweicloud.com/chromedriver
设置Electron镜像地址
npm config set electron_mirror https://mirrors.huaweicloud.com/electron/
设置electron_builder_binaries镜像地址
npm config set electron_builder_binaries_mirror https://mirrors.huaweicloud.com/electron-builder-binaries/
安装electron
npm install --save-dev electron
安装yarn
npm install -g yarn
设置yarn镜像
yarn config set registry https://mirrors.huaweicloud.com/repository/npm/
下载electron-builder
yarn add electron-builder --dev