各种环境配置

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/

 

posted @ 2024-01-29 16:24  cmwang2017  阅读(16)  评论(0编辑  收藏  举报