How do I resolve npm audit returning ENOAUDIT: Your configured registry does not support audit requests?

6.5k Views Asked by At

This recently broke and I do not know what I might have done to break it beyond adding some additional dependencies. I am using https://registry.npmjs.org/ (the default). The relevant portion of the log file is below. Has anyone seen something similar? I've only seen this referenced in some old bug reports.

6 info audit Submitting payload of 66980 bytes
7 http fetch POST 500 https://registry.npmjs.org/-/npm/v1/security/audits 548ms
8 verbose stack Error: Your configured registry (https://registry.npmjs.org/) does not support audit requests.
8 verbose stack     at Bluebird.all.spread.then.catch (C:\Users\micha\AppData\Roaming\npm\node_modules\npm\lib\audit.js:172:18)
8 verbose stack     at tryCatcher (C:\Users\micha\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
8 verbose stack     at Promise._settlePromiseFromHandler (C:\Users\micha\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
8 verbose stack     at Promise._settlePromise (C:\Users\micha\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
8 verbose stack     at Promise._settlePromise0 (C:\Users\micha\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
8 verbose stack     at Promise._settlePromises (C:\Users\micha\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:689:18)
8 verbose stack     at Async._drainQueue (C:\Users\micha\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:133:16)
8 verbose stack     at Async._drainQueues (C:\Users\micha\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:143:10)
8 verbose stack     at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\micha\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
8 verbose stack     at runCallback (timers.js:694:18)
8 verbose stack     at tryOnImmediate (timers.js:665:5)
8 verbose stack     at processImmediate (timers.js:647:5)
9 verbose cwd C:\src\studio-template
10 verbose Windows_NT 10.0.17134
11 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\micha\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "audit"
12 verbose node v10.11.0
13 verbose npm  v6.4.1
14 error code ENOAUDIT
15 error audit Your configured registry (https://registry.npmjs.org/) does not support audit requests.
2

There are 2 best solutions below

0
On

I see something similar when using npm v 6.14.6 with "overrides" in package.json

At first I thought the endpoint was rejecting my request because I had done so many iterations within a few hours. Then I tried removing "overrides" and "npm audit" started working again.


My goal was to resolve audit issues by changing package.json.

I did this by running "npm audit" to see the problem component versions, and the dependency tree that caused them to be included.

Then I updated the root component versions within package.json.

When this proved to not be enough I turned to the "overrides" section of package.json.

https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides

If you need to make specific changes to dependencies of your dependencies, for example replacing the version of a dependency with a known security issue . . .

0
On

Apparently, this was a transitory error. I'm guessing npmjs had issues on their end.