Skip to content

Commit e2d377b

Browse files
committed
1 parent 74da180 commit e2d377b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ Unix systems.
2828
* [`235e5d6df`](https://github.com/npm/cli/commit/235e5d6df6f427585ec58425f1f3339d08f39d8a)
2929
ensure correct owner on cached all-packages metadata
3030
([@isaacs](https://github.com/isaacs))
31+
* [`fa6acd2ea`](https://github.com/npm/cli/commit/fa6acd2ea035bf26c04d7885b534d03d5b77e7ba)
32+
[npm.community#8450](https://npm.community/t/npm-audit-fails-with-child-requires-fails-because-requires-must-be-an-object/8540)
33+
audit: report server error on failure ([@isaacs](https://github.com/isaacs))
3134

3235
### DEPENDENCIES
3336

lib/audit.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,10 @@ function auditCmd (args, cb) {
196196
} else if (err.statusCode === 404) {
197197
msg = `Your configured registry (${opts.registry}) does not support audit requests.`
198198
} else {
199-
msg = `Your configured registry (${opts.registry}) does not support audit requests, or the audit endpoint is temporarily unavailable.`
199+
msg = `Your configured registry (${opts.registry}) may not support audit requests, or the audit endpoint may be temporarily unavailable.`
200+
}
201+
if (err.body.length) {
202+
msg += '\nThe server said: ' + err.body
200203
}
201204
const ne = new Error(msg)
202205
ne.code = 'ENOAUDIT'

0 commit comments

Comments
 (0)