如何增加`yarn install`的超时时间

问题描述 投票:8回答:1

我目前正在非常不稳定的互联网连接上使用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".

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

谢谢!

download connection yarnpkg
1个回答
12
投票

尝试使用network-timeout标志,延迟时间为毫秒,如下所示:

yarn install --network-timeout 1000000000

© www.soinside.com 2019 - 2024. All rights reserved.