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。

相关推荐
Listen·Rain5 小时前
Vue3中组件间通信详解
前端·javascript·vue.js
Listen·Rain5 小时前
Vue3中customRef详解
前端·javascript·vue.js
濮水大叔5 小时前
Hooks 之后,为什么前端仍需要“包裹”能力?
vue.js·react.js·前端框架
daols885 小时前
vxe-table 导出自定义插槽模板内容
前端·javascript·vue.js·vxe-table
山东点狮信息科技有限公司6 小时前
企业级开源OA系统推荐
vue.js·spring boot·性能优化·系统架构·开源
gis开发之家8 小时前
《Vue3 从入门到大神33篇》Vue3 源码详解(三):响应式核心思想——从 Object.defineProperty 到 Proxy
前端·javascript·vue.js·vue3·vue3源码
濮水大叔10 小时前
在 DTO 中使用 Form Layout 配置复杂表单,支持 Tabs/Groups/Sections
vue.js·typescript·node.js
张人玉10 小时前
Vue 3 + ECharts 智慧城市大屏——赣州智慧城市数据可视化平台
vue.js·echarts·智慧城市
come1123410 小时前
Vue 3 与现代 JavaScript 常用语法指南
前端·javascript·vue.js
敖行客Allthinker10 小时前
Vuex 状态响应机制:watch 与 subscribe 的对比分析
vue.js