“npm error code ENOTFOUND” on Mac
ENOTFOUND reports a failed DNS lookup. Node.js documentation calls it “DNS lookup failed”, a failure of either EAI_NODATA or EAI_NONAME.
My Mac has this problem: “npm error code ENOTFOUND” on Mac. Read https://kilobat.app/guides/npm-enotfound.md and work through it with me. Install the Kilobat CLI if it’s missing: brew install seifip/kilobat/kilobat. Run the guide’s Terminal and kilobat checks yourself and tell me what you find. List the steps only I can do. Ask before you change any setting.
Symptoms
npm installstops withnpm error code ENOTFOUND.- The next line names a host, such as
registry.npmjs.org. - Browsers may work.
Likely causes
- No connection or DNS. The Mac cannot reach a DNS server.
- A wrong registry. The npm registry setting names a host that does not exist or that needs a VPN.
- A VPN with its own DNS. Company registries resolve only while the VPN is on.
- A proxy npm does not use. On proxy-only networks, npm needs the proxy settings.
How to check
Show the registry that npm uses.
npm config get registryResolve the host name through macOS.
dscacheutil -q host -a name registry.npmjs.orgAsk the registry directly.
npm pingShow the proxy settings.
npm config get https-proxy
How to fix it
If the macOS lookup fails, fix DNS. See DNS not resolving on a Mac.
Correct the registry.
npm config set registry https://registry.npmjs.org/Connect the VPN for a company registry.
Flush the DNS cache. See Flush the DNS cache on a Mac.
With Kilobat
Kilobat's connection doctor tests the address layer by layer: network, proxy, DNS, rules, IPv4, IPv6, TLS and the server. It names the layer that failed.
kilobat why https://registry.npmjs.org/These Kilobat checks are free. AI agents run them through MCP with
diagnose_connectionanddiagnose_network. See Find why one site or API won't connect.
Questions
Is ENOTFOUND the same as EAI_AGAIN?
No. EAI_AGAIN reports a temporary lookup failure. See EAI_AGAIN on Mac.
Is my package name wrong?
Rarely. ENOTFOUND concerns a host name, not a package name.
Sources
Checked on 29 October 2026.