npm ERR! code ENOTFOUND — request to https://registry.npmjs.org/x failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org
npm couldn’t resolve the registry hostname.
Seen on:
npm
Meaning
No internet, broken DNS, a wrong custom registry URL, or proxy settings needed.
Common causes
- Offline/DNS failure
- Typo in a custom registry URL
- Proxy required
⚡ Quick fix
- Check npm config get registry
- Test DNS: nslookup registry.npmjs.org
- Configure the proxy
Detailed fix by platform
npm
npm config get registry && npm config set registry https://registry.npmjs.org/
How to diagnose
- Registry — Correct URL?
- DNS — Resolves?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026