AI Diagnostic Summary

npm ERR! code ETIMEDOUT

Well-Documented Error

This error matches known, documented patterns with reliable solutions.

Quick Fix (Most Common Solution)

Seeing "npm ERR! code ETIMEDOUT"? This error can be frustrating, but it's usually fixable. It typically affects your development workflow or system. Below you'll find clear, step-by-step solutions to resolve this issue.

High confidence
What This Error Means

The connection to npm servers took too long.

Frequently documented in developer and vendor support forums.

Based on documented solutions and common real-world fixes.
Not affiliated with browser, OS, or device manufacturers.

New here? Learn why exact error messages matter →

Common Causes
  • Slow network
  • npm servers slow
  • Firewall blocking
How to Fix
  1. Check internet connection
  2. Try again later
  3. Use registry mirror

Last reviewed: March 2026 How we review solutions

Why This Happens

ETIMEDOUT means npm's TCP connection attempt to the registry server exceeded the timeout threshold without receiving a response. This is fundamentally a network latency or reachability problem. Unlike ENOTFOUND (DNS failure) or ENETUNREACH (no route), ETIMEDOUT means the connection was initiated but the remote server never responded within the allowed time. The most common cause is a firewall that silently drops outbound packets to the registry's IP address on port 443—corporate firewalls often block traffic to external services without sending a rejection, causing the client to wait until timeout. Overloaded proxy servers are the second most frequent cause: if your corporate HTTP proxy is under heavy load, it accepts the connection from npm but takes too long to forward it to the registry. VPN connections that route traffic through distant or congested tunnels can add enough latency to trigger timeouts, especially during large npm install operations that make hundreds of sequential requests. ISP-level issues like high packet loss or DNS-level blocking can also manifest as timeouts. npm's default timeout is 60 seconds for individual requests, but you can increase it if your network has high latency.

Quick Diagnostic Checklist
  1. Test connectivity to the registry: curl -v https://registry.npmjs.org/
  2. Check if a proxy or VPN is slowing the connection
  3. Try increasing npm timeout: npm config set fetch-retry-maxtimeout 120000
  4. Test with a different network (mobile hotspot) to isolate the issue
  5. Check firewall rules for outbound HTTPS (port 443) traffic
Diagnosing and fixing ETIMEDOUT connection issues
# Error output:
# npm ERR! code ETIMEDOUT
# npm ERR! errno ETIMEDOUT
# npm ERR! network request to https://registry.npmjs.org/express failed,
# npm ERR! network reason: connect ETIMEDOUT 104.16.23.35:443

# Step 1: Test direct connectivity
$ curl -v --connect-timeout 10 https://registry.npmjs.org/
# * Trying 104.16.23.35:443...
# * Connection timed out    <-- Network can't reach the registry

# Step 2: Check if proxy is needed
$ echo $HTTPS_PROXY
# (empty)   <-- Maybe proxy IS needed on corporate network
$ npm config set proxy http://proxy.company.com:8080
$ npm config set https-proxy http://proxy.company.com:8080

# Step 3: If proxy is already set, try without it
$ npm config delete proxy
$ npm config delete https-proxy
$ npm install

# Step 4: Increase timeout for slow connections
$ npm config set fetch-retry-maxtimeout 120000
$ npm config set fetch-retry-mintimeout 20000
$ npm config set fetch-retries 5
$ npm install

# Step 5: Try a different registry mirror
$ npm install --registry=https://registry.npmmirror.com/

# Step 6: Test with mobile hotspot to confirm network issue
# Disconnect from corporate/home network
# Connect to phone hotspot
$ npm install   # If this works, the issue is your network
Edge Cases & Unusual Scenarios

CI/CD behind firewall with IP allowlist

npm registry uses Cloudflare, which may change IP addresses. If your CI firewall allows specific IPs, the addresses may become stale. Allow the entire Cloudflare IP range (available at cloudflare.com/ips-v4) or use a registry proxy inside your network.

Slow connection with many dependencies

Large projects with hundreds of dependencies make sequential HTTP requests. On a slow connection, the cumulative time can trigger timeouts. Use npm install --prefer-offline to use cached packages where possible, reducing the number of network requests.

MTU mismatch causing packet fragmentation

VPN connections often reduce the MTU (Maximum Transmission Unit) size. Large npm responses may be fragmented and dropped by intermediate routers. Reduce the MTU on your network interface: sudo ip link set dev eth0 mtu 1400.

Need reliable hosting?

DigitalOcean offers simple cloud infrastructure with $200 free credit for new users.

Try DigitalOcean →

We may earn a commission from tools recommended in our fixes.

Optional follow-up

Some users ask whether saving fixes for recurring errors would be useful when the same issue appears again.

Was this explanation helpful?

Explanations are based on documented fixes, real-world reports, and common system behavior. GetErrorHelp is independent and not affiliated with software vendors, device manufacturers, or service providers.
Frequently Asked Questions

Is npm down?

Check status.npmjs.org for outages.

How do I use a mirror?

npm config set registry https://registry.npmmirror.com

What is npm default timeout?

npm waits up to 30 seconds per individual request by default. You can increase this with npm config set fetch-retry-maxtimeout 120000 (120 seconds). npm also retries failed requests up to 2 times by default.

Why does ETIMEDOUT only happen at work?

Your office network likely uses a firewall or proxy that restricts or slows outbound HTTPS traffic. The same install works at home because your home network does not filter traffic. Ask your IT team about proxy settings.

Can I use a mirror registry to avoid timeout issues?

Yes. Registry mirrors like npmmirror.com (China), or your own Verdaccio instance cache packages closer to your network. Set the mirror as your registry: npm config set registry https://registry.npmmirror.com/

Related Resources

Also Known As

Common Search Variations

Related Errors
Still Stuck?

Paste a different error message or upload a screenshot to get help instantly.

Solutions are based on commonly documented fixes and may not apply in all situations.