electron的镜像在国外,国内下载很慢,通过下面的方法,能极大地缩短下载和打包时间。
一般来说,先更新npm镜像为国内的地址
- #清空缓存
- npm cache clean -f
- #设置华为镜像源
- npm config set registry https://mirrors.huaweicloud.com/repository/npm/
修改浏览器引擎驱动镜像
- npm config set chromedriver_cdnurl https://mirrors.huaweicloud.com/chromedriver
把electron镜像改成国内镜像
- npm config set electron_mirror https://mirrors.huaweicloud.com/electron/
本页内容已结束,感谢您的来访!获取更多精彩文章,请收藏本站。
