How to fix npm ERR! code ETIMEDOUT npm ERR! network request to https://registry.npmjs.org timed out in React

ReactBEGINNERMEDIUMUpdated Dec 9, 2025· 755 views

This timeout error occurs when npm cannot connect to the registry within the configured timeout period. It typically happens during Create React App installation due to network connectivity issues, proxy configurations, or firewall restrictions.

Quick fix

Fixes ETIMEDOUT

npm config set fetch-timeout 60000
npm config set fetch-retry-mintimeout 20000
npm config set fetch-retry-maxtimeout 120000
  1. Increase npm timeout values
  2. Clear npm cache
  3. Verify and configure proxy settings
  4. Switch to HTTPS registry
react — error
npm config set fetch-timeout 60000
npm config set fetch-retry-mintimeout 20000
npm config set fetch-retry-maxtimeout 120000
npm ERR! code ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org timed out

What this error means

The ETIMEDOUT error indicates that npm's request to the package registry (registry.npmjs.org) exceeded the timeout threshold before receiving a response. This is a network-level error, not a problem with npm itself or the packages you're trying to install. When you run `npx create-react-app` or `npm install`, npm needs to download package metadata and files from the registry. If the connection is slow, blocked, or misconfigured, the request times out (default: 30 seconds). This is especially common in corporate networks with proxies, regions with slow connectivity to Cloudflare's CDN (which hosts the npm registry), or when firewall rules block registry access. The error doesn't mean the registry is down—it means your machine couldn't establish or maintain a connection within the allotted time.

Typical symptoms

  • npm install or npx create-react-app hangs and then fails
  • Error message shows "network request to https://registry.npmjs.org timed out"
  • Installation works on other networks but fails on corporate/restricted networks
  • Repeated attempts succeed inconsistently or fail repeatedly
  • Other npm commands like npm search also timeout

Common causes

  1. Default npm timeout (30 seconds) is too short for slow or congested network connections
  2. Corporate proxy or firewall blocking or slowing access to registry.npmjs.org
  3. Incorrect proxy configuration in npm settings causing connection failures
  4. DNS resolution issues preventing npm from reaching the registry
  5. Network instability or packet loss interrupting the connection
  6. IPv6 connectivity issues when npm attempts IPv6 before falling back to IPv4
  7. VPN or network security software interfering with npm connections
  8. Cloudflare CDN routing issues in certain regions

How to fix "npm ERR! code ETIMEDOUT npm ERR! network request to https://registry.npmjs.org timed out"

1Increase npm timeout values

First, try increasing the timeout to give npm more time to connect:

bash
npm config set fetch-timeout 60000
npm config set fetch-retry-mintimeout 20000
npm config set fetch-retry-maxtimeout 120000

Then retry your installation:

bash
npx create-react-app my-app

This gives npm up to 60 seconds for initial connections and up to 120 seconds for retries.

2Clear npm cache

Corrupted cache entries can cause timeout issues. Clear the cache and try again:

bash
npm cache clean --force
npx create-react-app my-app

This removes all cached packages and forces npm to download fresh copies.

3Verify and configure proxy settings

If you're behind a corporate proxy, check if npm has correct proxy configuration:

bash
# Check current proxy settings
npm config get proxy
npm config get https-proxy

# Set proxy (replace with your actual proxy URL and port)
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

# If proxy requires authentication
npm config set proxy http://username:password@proxy.company.com:8080
npm config set https-proxy http://username:password@proxy.company.com:8080

If you're NOT behind a proxy but these settings exist, remove them:

bash
npm config delete proxy
npm config delete https-proxy

Contact your IT team to verify the proxy URL and confirm registry.npmjs.org is not blocked.

4Switch to HTTPS registry

Ensure you're using the secure HTTPS registry URL:

bash
npm config set registry https://registry.npmjs.org/

Some networks handle HTTPS connections differently than HTTP, and the npm registry requires HTTPS for security.

5Disable IPv6 if necessary

IPv6 connectivity issues can cause timeouts. Force npm to use IPv4:

bash
npm config set ipv6 false

Then retry your installation. This prevents npm from attempting IPv6 connections that may fail or timeout.

6Test network connectivity to registry

Verify you can reach the npm registry directly:

bash
# Test DNS resolution and connectivity
ping registry.npmjs.org

# Test HTTPS connection
curl -I https://registry.npmjs.org/

If these commands fail or are very slow, the issue is with your network connection to the registry. Contact your network administrator or try a different network (mobile hotspot, home network, etc.).

7Use an alternative registry mirror

As a temporary workaround, you can use a registry mirror closer to your location:

bash
# Example: Use npmmirror in China
npm config set registry https://registry.npmmirror.com/

# Or use Yarn as an alternative package manager
npm install -g yarn
yarn create react-app my-app

Note: Only use trusted registry mirrors. After successful installation, you can switch back to the official registry.

Advanced notes

Corporate Network Considerations: Many enterprises use SSL inspection (man-in-the-middle proxies) that can interfere with npm's HTTPS connections. You may need to configure npm to use your company's CA certificate:

bash
npm config set cafile /path/to/company-ca-cert.pem
npm config set strict-ssl false  # Only as last resort, security risk

Network Configuration Files: npm reads configuration from multiple locations in this order: per-project (.npmrc in project root), per-user (~/.npmrc), global (/etc/npmrc). Check all locations for conflicting settings:

bash
npm config list

Diagnostics Logging: Enable verbose logging to see exactly where the timeout occurs:

bash
npm install --verbose
# or
npm install --loglevel silly

Retry Configuration: npm automatically retries failed requests. You can adjust retry behavior:

bash
npm config set fetch-retries 5
npm config set fetch-retry-factor 10

This retries 5 times with exponentially increasing delays (factor of 10).

Using .npmrc File: Instead of using npm config set, you can create a .npmrc file in your project or home directory:

ini
# .npmrc
fetch-timeout=60000
fetch-retry-mintimeout=20000
fetch-retry-maxtimeout=120000
registry=https://registry.npmjs.org/

Cloudflare Issues: The npm registry is hosted on Cloudflare's CDN. Occasionally, specific regions experience routing issues. Using a VPN to connect from a different region can work around this, though it's rarely necessary.

Frequently asked questions

What does "ETIMEDOUT" mean?
org) exceeded the timeout threshold before receiving a response. This is a network-level error, not a problem with npm itself or the packages you're trying to install. When you run npx create-react-app or npm install, npm needs to download package metadata and files from the registry.
How do I fix "ETIMEDOUT"?
This timeout error occurs when npm cannot connect to the registry within the configured timeout period. It typically happens during Create React App installation due to network connectivity issues, proxy configurations, or firewall restrictions.
What causes "ETIMEDOUT"?
Default npm timeout (30 seconds) is too short for slow or congested network connections Corporate proxy or firewall blocking or slowing access to registry.npmjs.org Incorrect proxy configuration in npm settings causing connection failures
Is the "ETIMEDOUT" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading