Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] SBOM omit dev too greedy #7909

Open
2 tasks done
torsten-bit opened this issue Nov 14, 2024 · 0 comments
Open
2 tasks done

[BUG] SBOM omit dev too greedy #7909

torsten-bit opened this issue Nov 14, 2024 · 0 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps

Comments

@torsten-bit
Copy link

torsten-bit commented Nov 14, 2024

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

When running npm sbom --omit dev, also packages will be omitted that are actually production-dependencies. In my example (see steps to reproduce), @angular/core and its transitive dependencies are not added to the SBOM.

The problem has to to with @angular/compiler having @angular/core as peerDependency and being a dev-dependency. Manually removing the peerDependencies and peerDependenciesMeta from the @angular/compiler-package in the package-lock.json will solve the issue.

Could you please have a look into this.

Expected Behavior

Production-dependencies and their transitive dependencies should be included into the SBOM, if not omitted.

Steps To Reproduce

  1. npm init
  2. npm i @angular/[email protected]
    3.1. npm sbom --sbom-format cyclonedx --omit dev --package-lock-only | grep bom-ref will include @angular/core
  3. npm i -D @angular/[email protected]
    4.1. npm sbom --sbom-format cyclonedx --omit dev --package-lock-only | grep bom-ref will NOT include @angular/core

Environment

  • npm: 10.9.0
  • Node.js: 22.11.0
  • OS Name: debian 12
  • System Model Name: PC
@torsten-bit torsten-bit added Bug thing that needs fixing Needs Triage needs review for next steps labels Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps
Projects
None yet
Development

No branches or pull requests

1 participant