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。

相关推荐
宿6746 小时前
tsconfig.node.json
前端·javascript·vue.js
lllsure8 小时前
Vue&React Router
前端·vue.js·react.js
踩着两条虫1 天前
VTJ.PRO AI Agent 技术白皮书
前端·vue.js·低代码
java1234_小锋1 天前
Vue3专题 - 列表渲染
vue.js
小锋java12341 天前
【技术专题】Vue3 - 列表渲染
vue.js·vite
zho_uzhou1 天前
ubuntu服务端运行vue网页步骤
linux·服务器·vue.js·ubuntu
滴滴答答哒2 天前
VUE3+element-plus MultiSelect 多选下拉组件
前端·javascript·vue.js
其美杰布-富贵-李2 天前
04 watch 与 Vue 响应式数据流
前端·javascript·vue.js
其美杰布-富贵-李2 天前
03 ref、reactive 与 computed 响应式数据
前端·javascript·vue.js
嘟嘟07172 天前
useRef + Web Worker:React 中的耗时计算不卡页面
javascript·vue.js