10

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:

Maria Ines Parnisari
  • 16,584
  • 9
  • 85
  • 130
Kasmir
  • 111
  • 1
  • 1
  • 6

4 Answers4

17

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

mooga
  • 3,136
  • 4
  • 23
  • 38
  • already tried that and didn't help. I doubt it's a network issue since it works with another computer – Kasmir Apr 25 '19 at 14:36
  • it's a network issue for the default timeout set in that computer – mooga Apr 25 '19 at 14:38
  • 3
    @Kasmir try that `yarn add YourPackageHere --network-timeout 600000` – mooga Apr 25 '19 at 14:40
  • 1
    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. Thanks – Kasmir Jul 15 '20 at 14:59
3

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)

ellockie
  • 3,730
  • 6
  • 42
  • 44
0

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.

BRO_THOM
  • 824
  • 9
  • 24
0

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

Sonam Gupta
  • 363
  • 2
  • 11