首页 > 解决方案 > npm 审核返回 400 错误请求

问题描述

当我运行 npm audit 我得到

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

我尝试了以下

delete pack lock
npm update
npm i

但它仍然在发生,我的 npm 版本是 6.14.11,我的节点版本是 v14.16.0

一旦我这样做

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

有用

知道为什么会这样吗?

标签: npmnpm-installnpm-audit

解决方案


推荐阅读