How to fix npm ERR! code ENETDOWN npm ERR! errno ENETDOWN npm ERR! Network is down in npm

npmINTERMEDIATEHIGHUpdated Dec 5, 2025ยท 139 views

The ENETDOWN error indicates your machine's network interface is down or unavailable, preventing npm from reaching the registry. This is typically caused by connectivity issues, network adapter problems, or proxy configuration conflicts.

Quick fix

Fixes npm ERR! code ENETDOWN npm ERR! errno ENETDOWN npm ERR! Network is down

ping -c 4 google.com
  1. Verify your internet connection is active
  2. Restart your network interface or networking service
  3. Check and clear proxy configuration
  4. Clear npm cache and retry
npm โ€” error
ping -c 4 google.com
npm ERR! code ENETDOWN
npm ERR! errno ENETDOWN
npm ERR! Network is down

What this error means

ENETDOWN is a system-level network error code that translates to 'Network is down.' When npm encounters this error, it means the operating system is reporting that the network interface is unavailable or disabled. This prevents npm from establishing a connection to registry.npmjs.org to download packages. Unlike other npm errors that indicate configuration or permission issues, ENETDOWN is a fundamental connectivity problem at the OS level. The error occurs during the 'connect' syscall when npm tries to communicate with the npm registry.

Typical symptoms

  • npm install fails immediately with ENETDOWN error message
  • No network connectivity on the machine or specific network interface is down
  • Other network-dependent applications also cannot connect (browser, curl, ping)
  • VPN connection drops or becomes unstable during package installation
  • Docker containers or VMs report network unavailable during npm operations

Common causes

  1. Network interface is disabled or disconnected (WiFi/Ethernet unplugged, airplane mode on)
  2. Network adapter driver malfunction or device is not properly initialized
  3. VPN connection dropped or experiencing connectivity issues
  4. Docker or virtual machine networking misconfigured or lost connectivity
  5. Firewall or network configuration blocking outbound connections to npm registry

How to fix "npm ERR! code ENETDOWN npm ERR! errno ENETDOWN npm ERR! Network is down"

1Verify your internet connection is active

Test basic connectivity to confirm your network interface is working. Open a terminal and run:

bash
ping -c 4 google.com

On Windows, use:

cmd
ping google.com

If ping fails or times out, your network interface is down. Try:
1. Toggling WiFi off and back on
2. Unplugging and replugging your Ethernet cable
3. Disabling airplane mode if enabled

2Restart your network interface or networking service

If your network shows as active but npm still fails, restart the networking stack.

On macOS:

bash
sudo ifconfig en0 down && sudo ifconfig en0 up

On Linux (systemd):

bash
sudo systemctl restart networking
# or for NetworkManager:
sudo systemctl restart NetworkManager

On Windows (PowerShell as Admin):

powershell
Disable-NetAdapter -Name "Ethernet" -Confirm:$false
Start-Sleep -Seconds 2
Enable-NetAdapter -Name "Ethernet" -Confirm:$false
3Check and clear proxy configuration

Misconfigured proxy settings can cause ENETDOWN errors. Check your npm configuration:

bash
npm config list

Look for any proxy, http-proxy, or https-proxy settings. If you're not behind a corporate proxy, remove them:

bash
npm config delete proxy
npm config delete http-proxy
npm config delete https-proxy

Also check environment variables:

bash
echo $HTTP_PROXY
echo $HTTPS_PROXY
unset HTTP_PROXY
unset HTTPS_PROXY
4Clear npm cache and retry

Sometimes cached data can cause persistent connection errors. Clear the npm cache:

bash
npm cache clean --force

Then try your npm install again:

bash
npm install
5If in Docker/VM, check container network

For Docker containers:
Ensure your container has network access:

bash
docker run --rm alpine ping -c 4 google.com

docker run --rm alpine nslookup registry.npmjs.org

If DNS fails, specify DNS servers when running the container:

bash
docker run --dns 8.8.8.8 --dns 8.8.4.4 your-image

Verify npm registry accessibility:

bash
curl -I https://registry.npmjs.org

Advanced notes

On Node.js 18+, IPv6 resolution issues can cause network errors. If you're experiencing ENETDOWN or related network errors with newer Node versions, try forcing IPv4:

bash
export NODE_OPTIONS="--dns-result-order=ipv4first"
npm install

Always check the full npm log file (located at ~/.npm/_logs/) for detailed error context.

Frequently asked questions

What does "npm ERR! code ENETDOWN npm ERR! errno ENETDOWN npm ERR! Network is dow" mean?
' When npm encounters this error, it means the operating system is reporting that the network interface is unavailable or disabled. org to download packages. Unlike other npm errors that indicate configuration or permission issues, ENETDOWN is a fundamental connectivity problem at the OS level.
How do I fix "npm ERR! code ENETDOWN npm ERR! errno ENETDOWN npm ERR! Network is dow"?
The ENETDOWN error indicates your machine's network interface is down or unavailable, preventing npm from reaching the registry. This is typically caused by connectivity issues, network adapter problems, or proxy configuration conflicts.
What causes "npm ERR! code ENETDOWN npm ERR! errno ENETDOWN npm ERR! Network is dow"?
Network interface is disabled or disconnected (WiFi/Ethernet unplugged, airplane mode on) Network adapter driver malfunction or device is not properly initialized VPN connection dropped or experiencing connectivity issues
Is the "npm ERR! code ENETDOWN npm ERR! errno ENETDOWN npm ERR! Network is dow" 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