ESOCKETTIMEDOUT error while yarn install command
Asked Answered
J

5

15

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 :

enter image description here

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:

Jaqitsch answered 25/4, 2019 at 9:15 Comment(0)
D
21

It's network problem I think you use the default timeout

A solution will be in .yarnrc file add that line

 network-timeout 600000

if 600000 didn't work try to increase and if .yarnrc not there then create it

Disseise answered 25/4, 2019 at 9:34 Comment(4)
already tried that and didn't help. I doubt it's a network issue since it works with another computerJaqitsch
it's a network issue for the default timeout set in that computerDisseise
@Jaqitsch try that yarn add YourPackageHere --network-timeout 600000Disseise
it's been a long time and I forgot to answer. if I set to 10 minutes as you said it works. I didn't set a high enough value in the first place. ThanksJaqitsch
D
8

An alternative to the .yarnrc solution is to provide the network timeout param to yarn install:

yarn install --network-timeout 600000

(found it here, it's also mentioned here)

Drifter answered 26/1, 2022 at 0:12 Comment(0)
D
2

I hope you've found a solution for yourself.

Today, I'm having the same problem. A work around I needed to try is to set a new timeout for yarn like our friend stated before.

I made it by running the following command 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.

Dwinnell answered 22/11, 2021 at 12:51 Comment(0)
R
1

I also encountered this issue recently in setting up a new project. It got solved for me using the command :-

yarn install --force --network-timeout 1000000

Ranchod answered 2/6, 2023 at 12:35 Comment(0)
C
0

It's not a network problem some time projects with a large number of dependencies or deep dependency trees may require more time to fetch all the required packages. Increasing the network timeout accommodates the additional time needed for fetching dependencies.

Using bellow code you increate additional time of 1000000 milliseconds, which is equivalent to 1000 seconds or 16 minutes and 40 seconds

yarn install --network-timeout 1000000
Clobber answered 8/5, 2024 at 16:52 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.