---
title: "npm error code ECONNRESET on Mac: why connections reset · Kilobat Guides"
url: "https://kilobat.app/guides/npm-econnreset.html"
description: "npm install on your Mac stops with npm error code ECONNRESET. Find the proxy, VPN, filter or network that resets the connection, and fix it."
---

Error messages

# “npm error code ECONNRESET” on Mac

ECONNRESET means that the other side closed the connection by force. Node.js documentation calls it “Connection reset by peer”.

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

## Symptoms

- `npm install` stops with `npm error code ECONNRESET`.
- npm adds that this is a problem related to network connectivity.
- It happens on a company network, a VPN or with a security app.

## Likely causes

- **A proxy or filter that resets connections.** A company proxy or security software can close connections that it does not allow.
- **TLS inspection.** A proxy that inspects secure traffic can break the connection. See [Corporate proxy certificates break Terminal tools on a Mac](https://kilobat.app/guides/corporate-proxy-certificates.html).
- **A VPN that reconnects.** Connections through the VPN close when it reconnects.
- **An unstable connection.** Node.js documentation says that a timeout or a reboot on the remote side can cause it.

## How to check

1. Show npm's registry and proxy settings.

   ```
   npm config get registry
   npm config get proxy
   npm config get https-proxy
   ```
2. Ask the registry for an answer.

   ```
   npm ping
   ```
3. Test the registry with curl. Look for the certificate issuer.

   ```
   curl -v -o /dev/null https://registry.npmjs.org/ 2>&1 | grep -i issuer
   ```
4. Try the install on another network, such as a phone hotspot.

## How to fix it

1. If the network needs a proxy, set it for npm.

   ```
   npm config set https-proxy http://proxy.example.com:8080
   ```
2. If a company proxy inspects TLS, add its root certificate for Node.js. See [Corporate proxy certificates break Terminal tools on a Mac](https://kilobat.app/guides/corporate-proxy-certificates.html).
3. Give npm more retries.

   ```
   npm config set fetch-retries 5
   ```
4. If a VPN, proxy or security app is on, turn it off for a short test. Turn it on again after the test.

## With Kilobat

1. Kilobat's connection doctor tests the registry 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.html).

## Questions

**Is ECONNRESET a bug in my project?**

Usually not. The connection to the registry closed. Run the same install on another network to compare.

## Sources

- [Node.js documentation: Common system errors](https://nodejs.org/api/errors.html#common-system-errors)
- intro(2), ECONNRESET, man page installed with macOS 27.2
- [npm Docs: config](https://docs.npmjs.com/cli/v11/using-npm/config)
- curl(1), man page installed with macOS 27.2

Sources checked on 29 October 2026. Man pages are the ones installed with macOS; open one with `man <name>` in Terminal.

## Related guides

- [“npm error code ETIMEDOUT” on Mac](https://kilobat.app/guides/npm-etimedout.html): ETIMEDOUT means that the other side did not answer in time.
- [Homebrew or npm downloads fail on a Mac](https://kilobat.app/guides/homebrew-npm-download-fails.html): Homebrew downloads with curl and Git.
- [Corporate proxy certificates break Terminal tools on a Mac](https://kilobat.app/guides/corporate-proxy-certificates.html): Some company networks inspect HTTPS traffic.
- [Proxy settings stop apps from connecting on a Mac](https://kilobat.app/guides/proxy-settings-breaking-apps.html): A proxy setting sends traffic through another server.
