Safeguard
Developer Tools•

npm audit flags a dev dependency: do I need to fix it?

A flaw in a dev dependency often matters less than one in production code, but not never. Here is how to judge it and which npm audit options to use.

Safeguard Security Team
3 min read

Often it matters less, but not never. A dev dependency does not ship to production, so a flaw in a test runner rarely exposes your users. It can still expose your build machines and your developers. Ask where the code runs and what it can touch, then decide.

What npm audit reports

npm audit sends a description of your dependency tree to the registry and reports known vulnerabilities. By default it covers everything in the tree, including development packages. Omitting dev dependencies changes what is installed and what is included in the report.

npm audit --omit=dev

This reports on what a production install would contain. Run both, and compare.

Questions that decide it

  1. Where does it run? Only on a laptop, or also in CI with deploy credentials?
  2. Does it handle untrusted input? A bundler that reads files you wrote is different from a tool that parses content from the internet.
  3. What does the advisory say? Many dev tool advisories need an attacker to feed crafted input to a local command, which is a narrow path.
  4. Is a fix available without breakage? If yes, take it.

Why you should not simply ignore it

Build machines often hold the most powerful secrets: registry tokens, cloud keys, signing material. A compromised dev tool running in CI can reach them. Developers' laptops are another route in. So the risk is about your pipeline rather than your product.

A sensible policy

Fix dev dependency findings that are high severity, or any that run in CI with secrets, soon. Batch the low ones into routine updates. Record a short reason when you accept one, with a review date.

When it gets noisy

Many findings in a deep tree are in packages you never call in a dangerous way. Reachability analysis helps separate those. If you want to see what is already in your own dependencies, Safeguard offers a free scan at https://gold.safeguard.sh/scan.

Try it yourself

Click through it at your own pace, or open it full screen. Sort the findings and notice which ones sit in development tooling rather than shipped code.

Quick check

Does npm audit include dev dependencies by default?

Yes. Use the omit option for dev to see what a production install would contain.

Should I run npm audit fix on dev findings?

Review what it changes first. Forced fixes can introduce breaking upgrades.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.