snippetbashTip
npm audit — Scan project dependencies for known security vulnerabilities. More information: <https://docs.npmjs.
Viewed 0 times
commandnpm auditdependenciescliknownscanforproject
Problem
How to use the
npm audit command: Scan project dependencies for known security vulnerabilities. More information: <https://docs.npmjs.com/cli/npm-audit/>.Solution
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 auditAutomatically fix vulnerabilities in the project's dependencies:
npm audit fixForce an automatic fix to dependencies with vulnerabilities:
npm audit fix {{[-f|--force]}}Update the lock file without modifying the
node_modules directory:npm audit fix --package-lock-onlyPerform a dry run. Simulate the fix process without making any changes:
npm audit fix --dry-runOutput audit results in JSON format:
npm audit --jsonConfigure the audit to only fail on vulnerabilities above a specified severity:
npm audit --audit-level {{info|low|moderate|high|critical}}Code Snippets
Scan the project's dependencies for known vulnerabilities
npm auditAutomatically fix vulnerabilities in the project's dependencies
npm audit fixForce an automatic fix to dependencies with vulnerabilities
npm audit fix {{[-f|--force]}}Update the lock file without modifying the `node_modules` directory
npm audit fix --package-lock-onlyPerform a dry run. Simulate the fix process without making any changes
npm audit fix --dry-runContext
tldr-pages: common/npm audit
Revisions (0)
No revisions yet.