How to fix npm ERR! code ENETDOWN npm ERR! errno ENETDOWN npm ERR! Network is down in npm
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- Verify your internet connection is active
- Restart your network interface or networking service
- Check and clear proxy configuration
- Clear npm cache and retry
ping -c 4 google.comnpm ERR! code ENETDOWNnpm ERR! errno ENETDOWNnpm 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
- 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
- Docker or virtual machine networking misconfigured or lost connectivity
- 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"
Test basic connectivity to confirm your network interface is working. Open a terminal and run:
ping -c 4 google.comOn Windows, use:
ping google.comIf 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
If your network shows as active but npm still fails, restart the networking stack.
On macOS:
sudo ifconfig en0 down && sudo ifconfig en0 upOn Linux (systemd):
sudo systemctl restart networking
# or for NetworkManager:
sudo systemctl restart NetworkManagerOn Windows (PowerShell as Admin):
Disable-NetAdapter -Name "Ethernet" -Confirm:$false
Start-Sleep -Seconds 2
Enable-NetAdapter -Name "Ethernet" -Confirm:$falseMisconfigured proxy settings can cause ENETDOWN errors. Check your npm configuration:
npm config listLook for any proxy, http-proxy, or https-proxy settings. If you're not behind a corporate proxy, remove them:
npm config delete proxy
npm config delete http-proxy
npm config delete https-proxyAlso check environment variables:
echo $HTTP_PROXY
echo $HTTPS_PROXY
unset HTTP_PROXY
unset HTTPS_PROXYSometimes cached data can cause persistent connection errors. Clear the npm cache:
npm cache clean --forceThen try your npm install again:
npm installFor Docker containers:
Ensure your container has network access:
docker run --rm alpine ping -c 4 google.com
docker run --rm alpine nslookup registry.npmjs.orgIf DNS fails, specify DNS servers when running the container:
docker run --dns 8.8.8.8 --dns 8.8.4.4 your-imageVerify npm registry accessibility:
curl -I https://registry.npmjs.orgAdvanced 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:
export NODE_OPTIONS="--dns-result-order=ipv4first"
npm installAlways 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
- ๐npm Official Documentation
- ๐ฌSO: ENETDOWN error code(Stack Overflow)
- ๐
- ๐Yarn Issue: ENETDOWN error(GitHub)