Skip to content
Latchkey

npm "ETIMEDOUT" reaching the registry in CI

npm opened a request to the registry and it did not complete within the timeout. The connection either never established or stalled mid-transfer, usually due to a slow proxy, congested egress, or a flaky registry mirror.

What this error means

npm install fails with "network request to https://registry.npmjs.org/... failed, reason: connect ETIMEDOUT" or "request to ... failed, reason: ETIMEDOUT".

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

Common causes

The path to the registry is slow or intermittent

A congested proxy, throttled egress, or a flaky mirror makes the connection or transfer exceed npm's timeout.

A wrong or unreachable registry endpoint

A misconfigured registry or proxy points npm at an IP that never answers, so every attempt times out.

How to fix it

Raise timeouts and retries

Give npm more time and attempts so a slow but reachable registry completes.

Terminal
npm config set fetch-timeout 120000
npm config set fetch-retries 5
npm install

Confirm the registry endpoint is reachable

Verify the registry URL npm is using and that it responds through the current network path.

Terminal
npm config get registry
curl -I "$(npm config get registry)"

How to prevent it

  • Cache the npm store between runs so packages are not refetched on every job.
  • Point CI at a reliable registry mirror close to the runner network.
  • Set generous fetch timeouts and retries for large dependency trees.

Frequently asked questions

What causes ""ETIMEDOUT""?
A congested proxy, throttled egress, or a flaky mirror makes the connection or transfer exceed npm's timeout.
How do I fix "ETIMEDOUT"?
Give npm more time and attempts so a slow but reachable registry completes.

Related guides

References

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