(新)yarn 错误There appears to be trouble with your network connection. Retrying

yarn 错误There appears to be trouble with your network connection. Retrying

先交代环境:
Ubuntu18
yarn --version
1.22.4
npm -v
6.14.4
node -v
v12.16.3

执行操作后报错信息
#yarn install
yarn install v1.22.4
[1/4] Resolving packages…
[2/4] Fetching packages…
info There appears to be trouble with your network connection. Retrying…
info There appears to be trouble with your network connection. Retrying…
info There appears to be trouble with your network connection. Retrying…
error An unexpected error occurred: “https://registry.npm.taobao.org/prettier/download/prettier-2.0.5.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fprettier%2Fdownload%2Fprettier-2.0.5.tgz: unexpected end of file”.

info If you think this is a bug, please open a bug report with the information provided in “/root/zbg_contract_website_h5_app_new/yarn-error.log”.

这里yarn install 过程中会有一个Fetching:
[2/4] Fetching packages…
[################################################################################] 1598/1602

这里有一个校验过程,这个文件你直接放到浏览器里是可以下载下来的。
所以这里使用 yarn add 直接添加这个依赖
yarn add
https://registry.npm.taobao.org/prettier/download/prettier-2.0.5.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fprettier%2Fdownload%2Fprettier-2.0.5.tgz

如图
图片1
加载成功了,然后跑yarn install 就很顺利pass了。

另外info提示网络问题,我看网络上绝大部份都是改成淘宝源。这个有可能解决一部分问题,但是还会有一些不管用的。
info There appears to be trouble with your network connection. Retrying…

这里有一个方法:绑定host
直接将绑定源节点 域名+IP写进host
你直接 dig registry.npm.taobao.org
图2
然后将得到的节点IP绑定到host,再执行命令的时候会解决一部分网络的问题。

完!

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值