npm audit return 400 Bad Request

7.1k views Asked by At

when I run npm audit I get

npm audit
npm ERR! code ENOAUDIT
npm ERR! audit Your configured registry (http://registry.npmjs.org/) may not support audit requests, or the audit endpoint may be temporarily unavailable.
npm ERR! audit The server said: <html>
npm ERR! audit <head><title>400 Bad Request</title></head>
npm ERR! audit <body>
npm ERR! audit <center><h1>400 Bad Request</h1></center>
npm ERR! audit <hr><center>cloudflare</center>
npm ERR! audit </body>
npm ERR! audit </html>
npm ERR! audit

and I tried the following

delete pack lock
npm update
npm i

but still it is happening my npm version is 6.14.11 and my node version is v14.16.0

As soon as I do this

npm audit --registry=https://registry.npmjs.org 

it works

Any idea why it is happening?

1

There are 1 answers

0
Michi MenZen On

The command line shows a hint that you should use https from now on

npm audit --audit-level=high --package-lock-only=true --registry=https://registry.npmjs.org