audit Verified current stable Not installed? Package Management

Audit / Filter Advisories By Severity

Filter Advisories By Severity

Performs a security audit on your `pnpm` dependencies, filtering results according to specified severity levels.

$
Terminal
pnpm audit --audit-level <severity>

When To Use

During a security compliance check before a production release.

Pro Tip

Use `--json` flag to get machine-readable output, which allows for programmatic handling of advisory data.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
pnpm audit --audit-level <severity>

Anatomy of Output

Understanding the result

┌──────────────────────────────┐ Advisory Output Header

Start of the advisory report.

│ moderate | Some package │ Severity Level

Severity level of the advisory.

│ vulnerable | path/to/package │ Affected Package Path

Path to the vulnerable package.

│ 9.0.1 | 2.0.0 │ Vulnerable Version / Patched Version

Versions of the package that are affected and patched.

└──────────────────────────────┘ Advisory Output Footer

End of the advisory report.

Troubleshooting

Common pitfalls

ERR_PNPM_AUDIT_NO_ADVISORIES

Solution: Ensure dependencies are installed correctly or check the lockfile.

ERR_PNPM_AUDIT_INVALID_SEVERITY

Solution: Use a valid severity level: low, moderate, or high.

ERR_PNPM_OP_FAILED

Solution: Check network connectivity or the registry status if the command fails.

Command Breakdown

What each part is doing

pnpm
Base Command
The executable that performs this operation. Here it runs Audit before the shell applies any redirect operators.
<severity>
severity
The value supplied for severity.
--audit-level
Command Option
Tool-specific option used by this command invocation.

Alternative Approaches

Comparable commands in other tools

Alternative package management tools for the same job.