简体   繁体   English

为企业注册 npm 启用审计命令

[英]Enable audit command for enterprise registry npm

My question is about how to enable npm audit command in my npm enterprise registry我的问题是关于如何在我的 npm 企业注册表中启用 npm audit 命令

When I am trying to run npm audit command i am getting the following error当我尝试运行 npm audit 命令时,出现以下错误

{
  "error": {
    "code": "ENOAUDIT",
    "summary": "Your configured registry (https://registry.npmjs.mydomain/) does not support audit requests.",
    "detail": ""
  }
}

Here is my research这是我的研究

I tried with the following command and its working我尝试使用以下命令及其工作

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

But when I use但是当我使用

npm audit --json --registry https://registry.npmjs.mydomain/

It does not work.这是行不通的。 How can I configure to make my registry to work with npm audit command如何配置以使我的注册表与 npm audit 命令一起使用

I have the same problem.我也有同样的问题。 We're using artifactory for private npm registry which doesn't support npm audit yet .我们正在将 artifactory 用于不支持 npm 审计的私有 npm 注册表。 Simplest solution which works for me is:对我有用的最简单的解决方案是:

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

Alternative solution :替代解决方案

  1. backup config file for your private registry (most probably it's ~/.npmrc)为您的私有注册表备份配置文件(很可能是 ~/.npmrc)
  2. change registry on public npm: npm set registry https://registry.npmjs.org更改公共 npm 上的注册表: npm set registry https://registry.npmjs.org
  3. use npm audit / npm audit fix使用npm audit / npm audit fix
  4. revert private registry configuration back恢复私有注册表配置

Update 2020 2020 年更新

In case of artifactory private npm registry - It does support npm audit now, so you can use npm audit / npm audit fix there without any additional configuration.人工私有 npm 注册表的情况下 - 它现在确实支持 npm 审核,因此您可以在那里使用npm audit / npm audit fix ,无需任何额外配置。 But if your private npm registry still doesn't support npm audit – steps above will be valid for you.但是如果你的私有 npm 注册中心仍然不支持 npm 审计——上面的步骤对你来说是有效的。

Jfrog Artifactory now fully support the 'npm audit' command (since version 6.10) Jfrog Artifactory 现在完全支持“npm audit”命令(从 6.10 版开始)

Furthermore, Using Jfrog Xray in combination with Artifactory will also enrich the audit report with more vulnerabilities and security info From Xray database.此外,将 Jfrog Xray 与 Artifactory 结合使用还将通过 Xray 数据库中的更多漏洞和安全信息丰富审计报告。

https://www.jfrog.com/confluence/display/RTF/Release+Notes#ReleaseNotes-Artifactory6.10 https://www.jfrog.com/confluence/display/RTF/Release+Notes#ReleaseNotes-Artifactory6.10

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM