audit Verified current stable Not installed? Package Management

Audit / Audit Dev Dependencies Only

Audit Dev Dependencies Only

Executes a security audit focused solely on development dependencies in a PNPM project.

$
Terminal
pnpm audit -D

When To Use

Before releasing a new version in a CI pipeline to ensure development dependencies are secure.

Pro Tip

Combine with `--json` for automated parsing and reporting of results in CI/CD pipelines.

Anatomy of Output

Understanding the result

{"advisories":[{"module":"eslint","severity":"high"}],"metadata":{}} Audit Result Summary

Indicates vulnerabilities found in development dependencies.

"module":"eslint" Vulnerable Module

Specific module affected by vulnerabilities.

Troubleshooting

Common pitfalls

Error: No dev dependencies listed in package.json.

Solution: Verify that your package.json has development dependencies defined.

Error: Timeout: audit task took too long.

Solution: Increase timeout settings or check network connectivity.

Error: Unexpected input detected.

Solution: Ensure valid flags are used when running the command.

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.
-D
D| dev
The value supplied for D| dev.
-D
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.