---
title: "“npm error code ENOTFOUND” on Mac · Kilobat Guides"
url: "https://kilobat.app/guides/npm-enotfound"
description: "npm install on your Mac stops with npm error code ENOTFOUND. The registry name did not resolve. Check DNS, the registry setting, a VPN and a proxy."
---

# “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.

**Fix this with your agent**Copies a prompt for Claude Code, Codex or any agent that can use Terminal.

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.

Applies to: npm 10 and later print “npm error”. Older versions print “npm ERR!”. Node.js on all current macOS versions. · Checked: 29 October 2026

## Symptoms

- `npm install` stops with `npm 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

1. Show the registry that npm uses.

   ```
   npm config get registry
   ```
2. Resolve the host name through macOS.

   ```
   dscacheutil -q host -a name registry.npmjs.org
   ```
3. Ask the registry directly.

   ```
   npm ping
   ```
4. Show the proxy settings.

   ```
   npm config get https-proxy
   ```

## How to fix it

1. If the macOS lookup fails, fix DNS. See [DNS not resolving on a Mac](https://kilobat.app/guides/dns-server-not-found).
2. Correct the registry.

   ```
   npm config set registry https://registry.npmjs.org/
   ```
3. Connect the VPN for a company registry.
4. Flush the DNS cache. See [Flush the DNS cache on a Mac](https://kilobat.app/guides/flush-dns-cache-mac).

## With Kilobat

1. 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/
   ```
2. These Kilobat checks are free. AI agents run them through MCP with `diagnose_connection` and `diagnose_network`. See [Find why one site or API won't connect](https://kilobat.app/guides/recipes/why-cant-it-connect).

## Questions

**Is ENOTFOUND the same as EAI_AGAIN?**

No. EAI_AGAIN reports a temporary lookup failure. See [EAI_AGAIN on Mac](https://kilobat.app/guides/eai-again).

**Is my package name wrong?**

Rarely. ENOTFOUND concerns a host name, not a package name.

## Sources

- [Node.js documentation: Common system errors](https://nodejs.org/api/errors.html#common-system-errors)
- [npm Docs: Common errors](https://docs.npmjs.com/common-errors)

Checked on 29 October 2026.

## Related guides

- [“npm error code ECONNRESET” on Mac](https://kilobat.app/guides/npm-econnreset): ECONNRESET reports a forcibly reset connection.
- [“npm error code ETIMEDOUT” on Mac](https://kilobat.app/guides/npm-etimedout): ETIMEDOUT means that the other side did not answer in time.
- [EAI_AGAIN on Mac](https://kilobat.app/guides/eai-again): EAI_AGAIN indicates that a name could not be resolved at this time.
- [“curl: (6) Could not resolve host” on Mac](https://kilobat.app/guides/curl-could-not-resolve-host): curl exit code 6 means that curl could not get an address for the host name.
