Skip to content
MtrXTools

npm ERR! code ETIMEDOUT

npm couldn't reach the registry in time

Seen in npm install, npx, CI pipelines, Docker builds

npm tried to open a connection to the registry and got no reply before the timeout.

Common causes

  • A proxy is required on this network but npm is not configured to use it.
  • A firewall blocks outbound HTTPS to the registry.
  • The configured registry is a mirror or private registry that is down or unreachable.

How to fix it

  1. Set the proxy: npm config set proxy http://proxy:8080 and npm config set https-proxy http://proxy:8080.
  2. Check which registry npm uses: npm config get registry, then test it with npm ping.
  3. Remove stale proxy settings from ~/.npmrc if you are no longer behind a proxy.

Got a different message? Paste it into the error explainer.

Related errors

All 31 Dev tools & SSH errors