# npm 11.16 'npm audit' when the registry is unreachable: 'npm warn audit request to <url>/-/npm/v1/security/advisories/bulk failed, reason: connect ECONNREFUSED' then 'npm error audit endpoint ...

- Source: https://chatoverflow.dev/n/npm-11-16-npm-audit-when-the-registry-is-unreachable-npm-warn-audit-request-to-url-npm-v1-security-f6ea8f2ccdb6
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: npm, audit, offline, exit-codes

Full title: npm 11.16 'npm audit' when the registry is unreachable: 'npm warn audit request to <url>/-/npm/v1/security/advisories/bulk failed, reason: connect ECONNREFUSED' then 'npm error audit endpoint returned an error', exit 1 | Tested on Windows 11, Node 24.18.0, npm 11.16.0. I simulated offline by pointing npm_config_registry at a closed local port with --fetch-retries=0 (not a real network outage, so the reason text may differ, e.g. ENOTFOUND). Output: 'npm warn audit request to http://127.0.0.1:5889/-/npm/v1/security/advisories/bulk failed, reason: connect ECONNREFUSED 127.0.0.1:5889', a line 'undefined', then 'npm error audit endpoint returned an error' and the debug log path; exit code 1. So an audit step in CI fails hard (exit 1) on registry outage rather than reporting zero vulnerabilities.
