Guides

npm sbom, pnpm sbom and uv export: built-in SBOMs tested

By SBOMBox SBOM experts · · 4 min read

Short answer: npm's built-in npm sbom is good enough to use as your release SBOM today, as long as you pass --omit dev. It scored 8.1 to 8.4 out of 10 in our tests and met NTIA, CISA, BSI and CRA rules except for supplier names. pnpm sbom and uv export --format cyclonedx1.5 produce correct dependency lists but leave out hashes or licenses, so they need a clean-up step before you share them.

What the commands are

Package managers know exactly which versions they installed, so they are the most faithful source of an SBOM. Three now ship a command for it. npm has had npm sbom since version 9.5 (CycloneDX 1.5 or SPDX 2.3). pnpm added pnpm sbom in version 11 (CycloneDX 1.5 to 1.7, or SPDX 2.3). uv added uv export --format cyclonedx1.5 in version 0.9.11; it is still marked as a preview feature. None of them needs a separate generator installed on your CI runners, which is one less third-party tool in your supply chain.

How we tested

We generated a CycloneDX SBOM for small, comparable projects with each command, using the flags you would use for a release: runtime dependencies only, application root, read from the committed lockfile. We then scored each file with the SBOMBox CLI (0-10 across eight categories) and checked it against the rulesets for NTIA minimum elements, CISA 2025, BSI TR-03183-2 2.1.0 and CRA readiness.

Results, 16 November 2026
CommandRaw scoreHashesLicensesSupplierDependency graph
npm sbom (npm 12.2.0)8.4/10 (B)Yes, SHA-512YesNoYes
npm sbom --package-lock-only8.1/10 (B)Yes, SHA-512YesNoYes
pnpm sbom (pnpm 11.28.12)6.0/10NoYesNoYes
pnpm sbom --lockfile-only4.7/10NoNoNoYes
uv export --format cyclonedx1.5 (uv 0.12.23)4.8/10Only on download linksNoNoYes

npm: use it, with three flags

npm sbom scored highest, but its defaults are wrong for a release SBOM:

npm sbom --sbom-format cyclonedx --sbom-type application --omit dev --package-lock-only > sbom.cdx.json

It also writes only to stdout, only reads package-lock.json (not Yarn or pnpm lockfiles), and still emits CycloneDX 1.5 with name@version references rather than purls. None of that stops it being useful; all of it is worth knowing before you build a pipeline on it.

pnpm: right packages, missing hashes

pnpm sbom has the better design: dev-only packages are marked excluded, --split writes one SBOM per workspace package, and you can set the CycloneDX version and the supplier. But it leaves out component hashes, even though pnpm-lock.yaml records an integrity hash for every package, and --lockfile-only also drops licenses. Copying the lockfile's integrity values into the SBOM raised our score from 6.0 to 7.9.

uv: a preview, and it shows

uv's export has a full dependency graph but no licenses, no suppliers, and puts SHA-256 hashes only on each package's download links rather than on the package. Run it at the root of a uv workspace without --all-packages and it silently returns an SBOM with no components. Promoting the source distribution's hash to the package raised our score from 4.8 to 6.6. Licenses still need an enrichment step.

Using them without writing glue code

sbombox generate now uses these commands first when it finds their lockfile and a new enough tool, with the release flags above, and applies the hash fixes for pnpm and uv. If a command fails, for example because the lockfile is out of date, it says why and falls back to cyclonedx-npm, cyclonedx-py, cdxgen or syft. The end-to-end workflow shows the whole pipeline, and the JavaScript and Python guides have the details. If you would rather not use SBOMBox, unify SBOMs across stacks has a vendor-neutral script that does the same selection.

Frequently asked questions

Does npm sbom include dev dependencies?

Yes, unless you pass --omit dev or set NODE_ENV=production. With node_modules installed it marks them required, so a consumer cannot tell them apart from runtime packages.

Does npm sbom work with Yarn or pnpm lockfiles?

No. It reads package-lock.json or npm-shrinkwrap.json only. Use pnpm sbom for pnpm, and cdxgen or syft for Yarn.

Which CycloneDX version does each command write?

npm writes 1.5. pnpm writes 1.7 by default and 1.5 or 1.6 on request with --sbom-spec-version. uv writes 1.5.