Skip to content
Latchkey

npm ETIMEDOUT Registry Request Failed in CI - Fix Network Timeouts

ETIMEDOUT means a request to the registry took too long and was abandoned. It is almost always a transient network condition that succeeds on retry.

What this error means

npm install fails partway through fetching packages with network request to ... failed and code ETIMEDOUT. Re-running the job usually completes with no change to the project.

npm
npm ERR! code ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/react failed,
reason: connect ETIMEDOUT 104.16.0.1:443

Common causes

Transient network or registry latency

A brief connectivity stall or slow registry response exceeds the fetch timeout. It reflects the network, not your project.

No caching, so every install hits the network

Cold installs that fetch everything remotely are more exposed to timeouts than cached ones.

How to fix it

Raise fetch retries and timeouts

  1. Increase npm fetch retry settings before installing.
  2. Re-run the install.
Terminal
npm config set fetch-retries 5
npm config set fetch-retry-mintimeout 20000
npm ci

Cache and mirror the registry

  1. Cache ~/.npm keyed on the lockfile so most installs are local.
  2. Use a registry mirror or proxy to cut external calls.

How to prevent it

  • Cache ~/.npm and raise fetch retries. Self-healing managed runners like Latchkey auto-retry transient registry timeouts and cache the npm registry, so an ETIMEDOUT usually clears without a manual re-run.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →