yarn安装包时报错error Error: certificate has expired

安装教程:

配置镜像地址:

npm config set registry https://registry.npmmirror.com

清除缓存:

yarn cache clean

//镜像:https://developer.aliyun.com/mirror/NPM

安装yarn:

npm install --global yarn

查看版本:

yarn --version

卸载:

npm uninstall -g yarn

安装固定版本yarn:

npm install -g [email protected]

错误1:error Error: certificate has expired

解决方案:

输入:yarn config list
在这里插入图片描述如果是true,输入:yarn config set strict-ssl false
解决问题。

错误2:info There appears to be trouble with your network connection. Retrying…

解决方案:

方法1:

更换淘宝镜像:

yarn config set registry https://registry.npmmirror.com

移除原代理:

yarn config delete proxy
npm config rm proxy
npm config rm https-proxy

方法2:

直接删除项目根目录的yarn.lock文件,再设置yarn国内镜像:

yarn config set registry https://registry.npmmirror.com

再安装 yarn:

yarn install

方法3.
将 yarn.lock 中的 https://registry.yarnpkg.com 换成 https://registry.npmmirror.com

如果遇到其他问题,然后试了各种方法未解决,比如一直报超时
info There appears to be trouble with your network connection. Retrying…
最后若还是解决不了:

请打开C:WindowsSystem32cmd.exe右键管理员模式运行,执行yarn install。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码
)">
< <上一篇
下一篇>>