【问题标题】:How to configure Nexus Repository Manager to support npm audit如何配置 Nexus Repository Manager 以支持 npm 审计
【发布时间】:2019-12-17 00:45:31
【问题描述】:

当我尝试在我的 (Angular 7) 应用程序中执行 npm audit 时,我收到以下 npm 错误:

npm 错误!代码 ENOAUDIT
npm 错误!审核您配置的注册表 (https://nexus.xxx.com/repository/yyy/) 没有 支持审计请求,或审计端点暂时 不可用。

有谁知道如何让 Nexus 支持npm audit

【问题讨论】:

    标签: npm nexus audit npm-audit


    【解决方案1】:

    如链接的 JIRA (NEXUS-16954) 中所述,应该可以使用 npm audit --registry=https://registry.npmjs.org 解决 NXRM。

    更新(2020 年 5 月 11 日):从 NXRM 版本 3.23 开始,npm audit 应该适用于配置了 Sonatype 防火墙或 IQ 服务器的系统。返回的消息应该不再错误,而是解释这一点。已打开 further JIRA ticket 以跟踪此命令在没有此处说明但未在此更新后实施的解决方法的情况下正常工作的愿望。

    【讨论】:

      【解决方案2】:

      npm audit --registry=https://registry.npmjs.org 的解决方案仅在您的 npm 客户端可以通过 Internet 访问 registry.npmjs.org 时才有效。

      如果不是这种情况,并且您不想为 Nexus Firewall 或 Nexus Lifecycle 付费,您可以设置另一个代理,将所有调用重定向到 https://nexus.xxx.com/repository/yyy/-/npm/v1/security/audits 并将其所有子路径重定向到 https://registry.npmjs.org/-/npm/v1/security/audits

      https://github.com/chovyy/npm-audit-proxy 之类的内容可能会有所帮助。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-08-20
        • 2019-04-30
        • 1970-01-01
        • 2011-08-07
        • 2019-04-30
        • 2014-07-05
        相关资源
        最近更新 更多