增加Yarn包下载超时,如何?

Fab*_*o K 13 connection download yarnpkg

我目前在非常不稳定的互联网连接上使用Yarn.有时需要几个小时才能最终下载所有软件包.

我注意到,当有某种互联网连接时,Yarn会修改下载内容:

[1/4] Resolving packages...
31-Dec-1969 21:00:00    [INFO] info There appears to be trouble with your 
network connection. Retrying...
31-Dec-1969 21:00:00    [ERROR] error An unexpected error occurred: 
"https://github.com/flot/flot: getaddrinfo EAI_AGAIN github.com:443".
Run Code Online (Sandbox Code Playgroud)

是否可以永久重试直到下载?像{timeout:9999999}这样的东西

谢谢!

Cro*_*ono 20

尝试network-timeout以毫秒为单位使用标志,如下所示:

yarn install --network-timeout 1000000000

  • 即使使用此命令(yarn 3.2.1),仍然收到“超时等待 'socket' 60000ms”错误。也许我会提出一个新问题...... (2认同)

ola*_*onm 10

你可以这样配置它:

yarn config set network-timeout 600000 -g
Run Code Online (Sandbox Code Playgroud)

  • 较新版本的纱线使用 `yarn config set httpTimeout 600000` - https://github.com/yarnpkg/berry/pull/1291 (2认同)