在使用yarn下载依赖时会报超时问题,解决贴

在使用yarn下载依赖时会报超时问题,解决贴

复制代码
这句话表示网络超时
There appears to be trouble with your network connection. Retrying

1、我们先使用命令查看使用使用的是国外的镜像。

复制代码
yarn config list

2、然后查看代码

3、更换镜像,设置使用国内镜像

复制代码
yarn config delete proxy

// 设置镜像地址为淘宝(地址1,推荐):
yarn config set registry https://registry.npmmirror.com
 
// 设置镜像地址为淘宝(地址2):
yarn config set registry https://registry.npm.taobao.org

4、再次输入命令查看

复制代码
yarn config list

代码中显示这行就代表设置成功了
registry: 'https://registry.npmmirror.com',

以上就解决了下载依赖速度慢的问题了。

相关推荐
mCell2 小时前
使用 useSearchParams 同步 URL 和查询参数
前端·javascript·react.js
mCell3 小时前
前端路由详解:Hash vs History
前端·javascript·vue-router
海上彼尚3 小时前
无需绑卡的海外地图
前端·javascript·vue.js·node.js
1024肥宅4 小时前
手写 call、apply、bind 的实现
前端·javascript·ecmascript 6
科杰智能制造4 小时前
纯前端html、js实现人脸检测和表情检测,可直接在浏览器使用
前端·javascript·html
每天吃饭的羊5 小时前
组件库的有些点击事件是name-click这是如何分装de
前端·javascript·vue.js
Coder-coco5 小时前
个人健康管理|基于springboot+vue+个人健康管理系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·后端·mysql·论文
x***01065 小时前
SpringSecurity+jwt实现权限认证功能
android·前端·后端
1024肥宅5 小时前
防抖(Debounce)
前端·javascript·ecmascript 6
1024肥宅5 小时前
节流(Throttle)
前端·javascript·ecmascript 6