npm audit
Scan project dependencies for known security vulnerabilities. More information: https://docs.npmjs.com/cli/npm-audit/.
- Scan the project's dependencies for known vulnerabilities:
npm audit
- Automatically fix vulnerabilities in the project's dependencies:
npm audit fix
- Force an automatic fix to dependencies with vulnerabilities:
npm audit fix
- Update the lock file without modifying the
node_modulesdirectory:
npm audit fix --package-lock-only
- Simulate the fix process without making any changes:
npm audit fix --dry-run
- Output audit results in JSON format:
npm audit --json
- Configure the audit to only fail on vulnerabilities above a specified severity:
npm audit --audit-level
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
