各种环境配置
1.设置为淘宝的镜像
npm config set registry https://registry.npm.taobao.org
查看npm镜像地址
npm config get registry
2.安装npm install -g @electron-forge/cli 进提示 request to https://registry.npm.taobao.org/@ctrl%2ftinycolor failed, reason: certificate has expired,是说证书过期了,解决方法如下
npm config set strict-ssl false
执行命令,设置不验证ssl证书即可。
3.electron修改镜像解决国内安装慢问题
npm config set registry https://registry.npm.taobao.org/ npm config set ELECTRON_MIRROR http://npm.taobao.org/mirrors/electron/
4.electron设置国内镜像
# 设置阿里镜像 npm config set registry=https://registry.npmmirror.com npm config set disturl=https://registry.npmmirror.com/-/binary/node # 设置electron仓库 npm config set electron_mirror=https://registry.npmmirror.com/-/binary/electron/
本文来自博客园,作者:cmwang2017,转载请注明原文链接:https://www.cnblogs.com/bm20131123/p/17994806