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

安装教程:

配置镜像地址:

bash 复制代码
npm config set registry https://registry.npmmirror.com

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

安装yarn:

bash 复制代码
npm install --global yarn

查看版本:

bash 复制代码
yarn --version

卸载:

bash 复制代码
npm uninstall -g yarn

安装固定版本yarn:

bash 复制代码
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:

更换淘宝镜像:

bash 复制代码
yarn config set registry https://registry.npmmirror.com

移除原代理:

bash 复制代码
yarn config delete proxy
npm config rm proxy
npm config rm https-proxy

方法2:

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

bash 复制代码
yarn config set registry https://registry.npmmirror.com

再安装 yarn:

bash 复制代码
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:\Windows\System32\cmd.exe右键管理员模式运行,执行yarn install。

相关推荐
hepherd8 分钟前
Vue学习笔记 - 插件
前端·vue.js
大强的博客2 小时前
《Vue Router实战教程》22.导航故障
前端·javascript·vue.js
2401_890665863 小时前
免费送源码:Java+SpringBoot+MySQL SpringBoot网上宠物领养管理系统 计算机毕业设计原创定制
java·vue.js·spring boot·python·mysql·pycharm·html5
爷傲奈我何!3 小时前
小程序中实现音频播放(原生 + uniapp)
前端·vue.js
jqq6663 小时前
(二)「造轮子」我也写了个Vue3脚手架!(项目环境搭建)
前端·javascript·vue.js
Json_3 小时前
vue2 + element-ui 开发网站拼图小游戏-前端项目
前端·vue.js·element
顾名思远义3 小时前
VxeGRid树形表格编辑难点
前端·vue.js
爱的叹息3 小时前
状态管理组件Pinia 简介与底层原理 、Pinia 与其他状态管理库对比、Vue3 + Element Plus + Pinia 安装配置详解
前端·javascript·vue.js
bingbingyihao4 小时前
vue拓扑图组件
前端·javascript·vue.js