How to fix npm ERR! code EHOSTDOWN npm ERR! errno EHOSTDOWN npm ERR! Host is down in npm

npmINTERMEDIATEHIGHUpdated Dec 5, 2025ยท 142 views

The EHOSTDOWN error occurs when npm cannot connect to the npm registry or another host due to network issues, firewall blocks, or IPv6 misconfigurations. Fixing it requires checking your network connectivity and registry configuration.

Quick fix

Fixes npm ERR! code EHOSTDOWN npm ERR! errno EHOSTDOWN npm ERR! Host is down

# Test basic internet connectivity
ping 8.8.8.8

# Test DNS resolution
ping registry.npmjs.org
  1. Check your internet connection and registry status
  2. Clear npm cache and check your configuration
  3. Disable IPv6 as a network diagnostic step
  4. Configure npm to work with a proxy
npm โ€” error
# Test basic internet connectivity
ping 8.8.8.8
# Test DNS resolution
ping registry.npmjs.org
npm ERR! code EHOSTDOWN
npm ERR! errno EHOSTDOWN
npm ERR! Host is down

What this error means

EHOSTDOWN is a network-level error that indicates the npm client was unable to reach the specified host. This typically happens when npm tries to connect to registry.npmjs.org or a custom npm registry, but the connection is blocked or the host is unreachable. The error can stem from several sources: your internet connection may be down, a firewall or corporate proxy may be blocking access, DNS resolution may be failing, or IPv6 routing issues may be preventing the connection. Unlike ECONNREFUSED (which means the server rejected the connection), EHOSTDOWN means the client couldn't even reach the host to attempt a connection.

Typical symptoms

  • npm install fails immediately with 'EHOSTDOWN' error when trying to fetch packages
  • ping registry.npmjs.org succeeds but npm install fails
  • npm works fine on a different network but fails on your current network
  • npm commands fail only when behind a corporate firewall or VPN
  • The error occurs intermittently, sometimes succeeding and sometimes failing

Common causes

  1. IPv6 is enabled on your system and routing traffic through IPv6 addresses that don't have proper connectivity to the registry
  2. A firewall (personal, corporate, or ISP-level) is blocking outbound HTTPS connections to registry.npmjs.org on port 443
  3. Your system's DNS cannot resolve registry.npmjs.org to its IP address
  4. You're behind a corporate proxy that requires authentication or configuration
  5. The npm registry is temporarily experiencing an outage

How to fix "npm ERR! code EHOSTDOWN npm ERR! errno EHOSTDOWN npm ERR! Host is down"

1Check your internet connection and registry status

First, verify that your internet is actually working and the npm registry is online.

bash
# Test basic internet connectivity
ping 8.8.8.8

# Test DNS resolution
ping registry.npmjs.org

If ping to 8.8.8.8 fails, your internet is down. If ping to registry.npmjs.org fails or shows 'Destination Host Unreachable', you have a firewall or routing issue. Check https://status.npmjs.org for registry outages.

2Clear npm cache and check your configuration

Clear any corrupted cache and review your npm configuration:

bash
npm cache clean --force

npm config ls

npm config get registry
npm config get proxy
npm config get https-proxy

Verify the registry is set to https://registry.npmjs.org (or your custom registry). If you see proxy values set, make note of them as they may be causing the issue.

3Disable IPv6 as a network diagnostic step

IPv6 misconfigurations are a common cause of EHOSTDOWN errors. Temporarily disable it to test:

On Linux/macOS:

bash
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1

On Windows (PowerShell as Admin):

powershell
Reg add HKLM\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters /v DisabledComponents /t REG_DWORD /d 0xff

After disabling IPv6, try npm install again. If it succeeds, you've found the root cause.

4Configure npm to work with a proxy

If you're behind a corporate firewall or proxy, configure npm to use it:

bash
npm config set proxy http://proxy.example.com:8080
npm config set https-proxy http://proxy.example.com:8080

npm install

To reset proxy settings later:

bash
npm config set proxy null
npm config set https-proxy null
5Check .npmrc files and verify network access

Your local and global .npmrc files may have stale or incorrect configuration:

bash
cat ~/.npmrc
cat .npmrc

npm config ls --all

Look for any unusual registry URLs, proxy settings, or other network-related config. If you find incorrect entries:

bash
npm config delete registry
npm config delete proxy

If still having issues, try with verbose output:

bash
npm install --verbose

Advanced notes

EHOSTDOWN is a lower-level socket error that indicates the host is unreachable at the network level, different from ECONNREFUSED (connection rejected) or ENOTFOUND (DNS lookup failed). If IPv6 disabling fixes your issue, consider making it permanent on your system. Some users have reported that connecting to a VPN resolves EHOSTDOWN issues, suggesting the problem may be ISP-level routing or firewall policies. If you're using a corporate network, contact your IT department about proxy requirements or firewall rules blocking port 443 to registry.npmjs.org.

Frequently asked questions

What does "npm ERR! code EHOSTDOWN npm ERR! errno EHOSTDOWN npm ERR! Host is down" mean?
EHOSTDOWN is a network-level error that indicates the npm client was unable to reach the specified host. org or a custom npm registry, but the connection is blocked or the host is unreachable. The error can stem from several sources: your internet connection may be down, a firewall or corporate proxy may be blocking access, DNS resolution may be failing, or IPv6 routing issues may be preventing the connection.
How do I fix "npm ERR! code EHOSTDOWN npm ERR! errno EHOSTDOWN npm ERR! Host is down"?
The EHOSTDOWN error occurs when npm cannot connect to the npm registry or another host due to network issues, firewall blocks, or IPv6 misconfigurations. Fixing it requires checking your network connectivity and registry configuration.
What causes "npm ERR! code EHOSTDOWN npm ERR! errno EHOSTDOWN npm ERR! Host is down"?
IPv6 is enabled on your system and routing traffic through IPv6 addresses that don't have proper connectivity to the registry A firewall (personal, corporate, or ISP-level) is blocking outbound HTTPS connections to registry.npmjs.org on port 443 Your system's DNS cannot resolve registry.npmjs.org to its IP address
Is the "npm ERR! code EHOSTDOWN npm ERR! errno EHOSTDOWN npm ERR! Host is down" error serious?
Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.

Official resources & further reading