You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

npm 6.0.0执行npm install出现漏洞提示:原因及禁用方法

npm 6.0.0中npm install出现安全漏洞提示的原因及解决办法

Hey there! Let's break down what's going on with that npm install message you're seeing in npm 6.0.0.

为什么会弹出这个提示?

Starting with npm 6.0.0, the npm install command automatically runs a security audit on all your installed packages. This is a built-in feature from npm to help you keep your project dependencies safe. The message you're seeing is just the summary of that audit:

  • It checked 15,904 packages in your project
  • Found 52 total vulnerabilities, categorized by severity: 8 low, 40 moderate, and 4 high
    The Run npm audit for more detail line is telling you you can dig deeper into exactly which packages have issues and how to fix them.

怎么禁用这个提示?

If you don't want to see this audit summary every time you run npm install, you've got a few options:

1. 单次安装时临时禁用

给npm install命令加上--no-audit参数即可:

npm install --no-audit

这个设置只对当前这次安装生效,后续执行npm install还会默认显示审计提示。

2. 全局永久禁用

通过npm全局配置关闭审计功能:

npm config set audit false

如果之后想恢复审计提示,执行以下命令即可:

npm config set audit true

3. 仅针对当前项目禁用

在项目根目录的.npmrc文件中添加以下内容,这个设置只会对当前项目生效:

audit=false

内容的提问来源于stack exchange,提问作者tPointer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 07:25:14