简体   繁体   English

"纱线安装命令时出现 ESOCKETTIMEDOUT 错误"

[英]ESOCKETTIMEDOUT error while yarn install command

I'm having troubles with yarn but only on one computer.我在使用纱线时遇到问题,但仅在一台计算机上。

When I run yarn install some packages can't be downloaded and I have this error : ESOCKETTIMEDOUT :当我运行yarn install时,一些软件包无法下载,并且出现此错误: ESOCKETTIMEDOUT :

在此处输入图像描述

At first I just thought that there were some issues at the repository but:起初我只是认为存储库中存在一些问题,但是:

  1. I can download the package through a web browser我可以通过网络浏览器下载包

  2. I didn't have any issue with another computer我在另一台电脑上没有任何问题

I tried with the latest version of yarn too and still have this error.我也尝试了最新版本的纱线,但仍然有这个错误。

1 : 1

Hello I'm having troubles with yarn but only on one computer.您好,我在使用纱线时遇到麻烦,但是只能在一台计算机上。

When I run "yarn install" some packages can't be downloaded and I have this error : ESOCKETTIMEDOUT : screenshot当我运行“ yarn install”时,某些软件包无法下载,并且出现此错误:ESOCKETTIMEDOUT:屏幕截图

At first I just thought that there were some issues at the repository but:起初,我只是认为存储库中存在一些问题,但是:

1- I can download the package through a web browser 1-我可以通过网络浏览器下载软件包

2- I didn't have any issue with another computer 2-我在另一台计算机上没有任何问题

I tried with the latest version of yarn too and still have this error我也尝试了最新版本的纱线,但仍然出现此错误

Someone got an idea about it?有人对此有想法吗?

I hope you've found a solution for yourself.我希望你已经为自己找到了解决办法。

Today, I'm having the same problem.今天,我遇到了同样的问题。 A workaround I needed to try is to set a new timeout for yarn like our friend stated before.我需要尝试的一种解决方法是像我们的朋友之前所说的那样为纱线设置新的超时时间。 Although, I made it running the command yarn config set network-timeout 300000 in my project root.虽然,我让它在我的项目根目录中运行命令yarn config set network-timeout 300000

It's easier to set your parameter time out instead of creating a new file with your yarn configurations.设置参数超时比使用纱线配置创建新文件更容易。

An alternative to the .yarnrc solution is to provide the network timeout param to yarn install : .yarnrc解决方案的替代方案是向yarn install提供网络超时参数:

yarn install --network-timeout 600000

(found it here , it's also mentioned here ) (在这里找到,这里也提到

尝试将网络超时600000添加到您的.yarnrc中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM