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 yarn@1.22.17

错误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。

相关推荐
码上暴富3 小时前
el-table表格全屏/管理显示字段/导出功能封装
vue.js
超人不会飞_Jay3 小时前
26.6.3Vue笔记
前端·vue.js·笔记
御坂100273 小时前
Vue - @change应用实现下拉框联动功能
前端·javascript·vue.js
瘦瘦瘦大人3 小时前
Vue 项目实现关闭/刷新浏览器窗口前的离开确认提示
前端·javascript·vue.js
belong_my_offer4 小时前
认识前端路由& VSCode 实操
vue.js
吃阿茶搽4 小时前
大模型RAG实战,从被骂不靠谱到成为部门MVP,我的踩坑全记录
vue.js
布兰妮甜5 小时前
Vue 视图不更新?常见赋值踩坑点汇总
前端·javascript·vue.js·vue踩坑·vue视图不更新
rising start5 小时前
三、Vue3 模板语法
vue.js
zhedream6 小时前
十万级列表的跨页多选方案:el-table 踩坑与治理实践
vue.js·element
rising start6 小时前
二、Vue3 核心基础:API 对比、Setup 与响应式详解
前端·javascript·vue.js