Skip to content
Latchkey

CI "Connection timed out" (ETIMEDOUT) Downloading

A connection attempt timed out before the server responded. In CI this is typically a transient network stall reaching a registry, mirror, or asset host.

What this error means

A download or API call fails with ETIMEDOUT / Connection timed out after a hang. Re-running the unchanged job usually succeeds, the hallmark of a transient blip.

shell
npm error code ETIMEDOUT
npm error network request to https://registry.npmjs.org/... failed, reason: connect ETIMEDOUT 104.16.0.35:443

Common causes

Transient network congestion or packet loss

A momentary stall between the runner and the remote host keeps the connection from completing in time.

A slow or overloaded upstream

A registry or mirror under load may not answer within the client timeout.

How to fix it

Retry with backoff and a sane timeout

Bounded retries absorb a transient stall.

shell
npm config set fetch-retries 5
npm config set fetch-retry-maxtimeout 120000
npm ci

Reduce exposure to the slow path

  1. Cache dependencies so fewer downloads are needed.
  2. Use a closer/faster mirror where available.
  3. Pin versions to avoid extra metadata round-trips.

How to prevent it

  • Configure client retries for network fetches.
  • Cache dependencies between runs.
  • On managed runners, transient timeouts are detected and the job is automatically retried, so a one-off stall does not fail the build.

Frequently asked questions

What causes "ETIMEDOUT downloading"?
A momentary stall between the runner and the remote host keeps the connection from completing in time.
How do I fix ETIMEDOUT downloading?
Bounded retries absorb a transient stall.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card