Skip to content
New issue

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

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

Already on GitHub? # to your account

[BUG] SBOM omit dev too greedy #7909

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

[BUG] SBOM omit dev too greedy #7909

torsten-bit opened this issue Nov 14, 2024 · 2 comments
Labels
Bug thing that needs fixing Priority 2 secondary priority issue

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/core@18.2.11
  3. npm sbom --sbom-format cyclonedx --omit dev --package-lock-only | grep bom-ref will include @angular/core
  4. npm i -D @angular/compiler@18.2.11
  5. 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
@kchindam-infy
Copy link

@torsten-bit Step 4.0 is missing, Please provide the complete steps to reproduce to better troubleshoot further.

@torsten-bit
Copy link
Author

Hi @kchindam-infy, sorry I got the numbering wrong. But it has been fixed now.

@kchindam-infy kchindam-infy added Priority 2 secondary priority issue and removed Needs Triage needs review for next steps labels Dec 13, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug thing that needs fixing Priority 2 secondary priority issue
Projects
None yet
Development

No branches or pull requests

2 participants