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:443Common 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
- Increase npm fetch retry settings before installing.
- Re-run the install.
Terminal
npm config set fetch-retries 5
npm config set fetch-retry-mintimeout 20000
npm ciCache and mirror the registry
- Cache ~/.npm keyed on the lockfile so most installs are local.
- 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
npm ETIMEDOUT "network request … failed, reason: connect ETIMEDOUT" - Fix in CIFix npm ETIMEDOUT "connect ETIMEDOUT" in CI - a connection to the registry that timed out, usually a transien…
npm ECONNRESET in CI - Fix Dropped Registry ConnectionsFix npm ECONNRESET errors in CI when the registry connection is reset mid-download, using retries, caching, a…
npm Registry 429 Too Many Requests in CI - Fix Rate LimitingFix npm registry 429 Too Many Requests errors in CI by authenticating, caching, and mirroring to stay under r…