cacheport

Error · Yarn

Fixing Yarn "trouble with your network connection" and ESOCKETTIMEDOUT

Yarn 1 timed out while downloading a tarball and is retrying. If the retries also time out, the install fails with ESOCKETTIMEDOUT. Large packages are the usual victims because they take longest to download.

What you see

build log
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/typescript/-/typescript-5.6.3.tgz: ESOCKETTIMEDOUT".

Common causes

  • The default network timeout of 30 seconds is too short for large tarballs on slow links.
  • Many parallel downloads saturating the runner's connection.
  • A distant or congested route to the registry.

How to fix it

  1. 01

    Raise the timeout

    Give large downloads more time.

    shell
    yarn install --frozen-lockfile --network-timeout 600000
  2. 02

    Lower concurrency

    Fewer parallel downloads finish more reliably on a slow link.

    shell
    yarn install --network-concurrency 4
  3. 03

    Download from your region

    A registry cache next to the runner removes the slow link for every package already cached.

    .npmrc
    registry=https://acme.cacheport.cc/npm/
    //acme.cacheport.cc/npm/:_authToken=${CACHEPORT_TOKEN}

Other network failures in builds

Start on the free plan

20 GB of cache, every registry, unlimited users. Upgrade when your pipelines outgrow it.