Closed AndreVirtimo closed 2 years ago
I have tried this on another project without "prod" dependencies and only dev dependencies. It seems that all dev dependencies are added to the BOM as DummyComponent.
thank you for the report, @AndreVirtimo . i will check into this. could you do the broken call again, and paste me the logs? they might look like the following:
DEBUG | options: {"ignoreNpmErrors":false,"packageLockOnly":false,"omit":[],"flattenComponents":false,"shortPURLs":false,"specVersion":"1.4","outputFormat":"JSON","outputFile":"-","mcType":"application"}
DEBUG | packageFile: /.../some/path/package.json
DEBUG | projectDir: /.../some/path
DEBUG | detected a package lock file
DEBUG | makeNpmRunner caused execSync "npm" undefined
INFO | gather dependency tree ...
DEBUG | npm-ls: run npm with ["ls","--json","--all","--long"] in "/.../some/path"
INFO | build BOM ...
INFO | writing BOM to -
PS: tried to reproduce with all the information you gave and the exact dependencies from your report, and was not able to reproduce.
The exact opposite was the case: when called with --omit dev
then @cyclonedx/cyclonedx-npm
was not in the resulting SBOM. when called without any --omit
then @cyclonedx/cyclonedx-npm
was part of the SBOM. in both cases no DummyComponent
was part of the SBOM.
could you create a github repo with a setup that isolates your issue and makes it reproducible?
i would immagine a repo that contains a package.json
, a package-lock.json
, the sbom.json
you produced.
Could you include additionally the output from npm ls --omit dev
in a file, so that it can be comparred agains the other files? It could be the case that npm
might have some troubles.
previously i tried with some arbitrary npm@^8
Since you reported to use npm@8.5.1
I tried again to reproduce with that exact version, and finally was able to see the same you described.
I found the issue was gone when i used npm@^8.7
- see https://github.com/npm/cli/pull/4744
Seams like npm
had an issue back then - see https://github.com/npm/cli/issues/4739
I am sorry, you might need to upgrade your NPM to a version >= 8.7.0 to fix this issue.
Will change internal implementations of this tool to circumvent the issue. see #259
@jkowalleck thank you for checking this issue.
I can confirm that this issue was gone after updating npm to version 8.19.2.
this issue was fixed in v1.3.0 of cyclonedx-npm
When I'm using the "--omit dev" parameter then I got a lot of entries with the prefix "DummyComponent.InterferedDependency."
I'm using "@cyclonedx/cyclonedx-npm" version 1.2.0 as dev dependency. And it seems this is also in the BOM which I didn't expected.
To Reproduce
Snippet from my package.json with to internal dependencies removed.
Expected behavior
No dummy entries and no dev dependencies.
Environment
npm - 8.5.1 node - v17.6.0
macOS 12.6