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

Add support for NPM lock file v2 #242

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

asaberwd
Copy link

Signed-off-by: ahmed saber [email protected]
Fix issue #231 adding support for NPM lock file version 2
@niravpatel27

@alexthemark
Copy link

Hey @asaberwd @RodneyRichardson is this PR still alive (and planning on merging into a soon-ish version)? I'd love to use this to generate an SBOM for an application I'm building.

@RodneyRichardson
Copy link

Sorry, I don't know - I was just poking my nose in and commenting!

@asaberwd
Copy link
Author

asaberwd commented Jul 3, 2022

@alexthemark sorry Alex i made the fix but have no idea if the maintainers of the project still working on it or accepting any new changes.

Signed-off-by: ahmed saber <[email protected]>
Signed-off-by: ahmed saber <[email protected]>
@niravpatel27
Copy link
Collaborator

@asaberwd, the build is failing.

@colek42
Copy link

colek42 commented Oct 18, 2022

@asaberwd @nishakm, what is the status of the PR? I'd like to use this for npm V7. Happy to get the build working if y'all are busy.

-Cole

@nishakm
Copy link
Collaborator

nishakm commented Oct 18, 2022

@colek42 I'll take a look. I disabled CI builds for now, but this PR may fix it.

@nishakm
Copy link
Collaborator

nishakm commented Oct 18, 2022

@asaberwd Will you be able to resolve the conflicts? If you can I will merge it.

@colek42
Copy link

colek42 commented Oct 18, 2022

@nishakm I'll have something ready in a few days.

@asaberwd
Copy link
Author

@nishakm conflicts resolved

@nishakm
Copy link
Collaborator

nishakm commented Oct 25, 2022

@asaberwd I'm getting an error when running the tool on the npm test app:

INFO[2022-10-25T13:16:43Z] Starting to generate SPDX ...                
INFO[2022-10-25T13:16:43Z] Running generator for Module Manager: `npm` with output `bom-npm.spdx` 
INFO[2022-10-25T13:16:43Z] Current Language Version 8.10.0              
INFO[2022-10-25T13:16:43Z] Global Setting File                          
panic: interface conversion: interface {} is string, not map[string]interface {}

goroutine 1 [running]:
github.com/spdx/spdx-sbom-generator/pkg/modules/npm.(*npm).buildDependencies(0xc0000701e0, {0xb8d68d, 0x1}, 0x8, 0x307f948)
        /src/pkg/modules/npm/handler.go:214 +0x128b
github.com/spdx/spdx-sbom-generator/pkg/modules/npm.(*npm).ListModulesWithDeps(0xc0000701e0, {0xb8d68d, 0x1}, {0x16, 0xc00307f9c0})
        /src/pkg/modules/npm/handler.go:185 +0x205
github.com/spdx/spdx-sbom-generator/pkg/modules.(*Manager).Run(0xc0000702d0)
        /src/pkg/modules/modules.go:102 +0x15b
github.com/spdx/spdx-sbom-generator/pkg/handler.(*spdxHandler).Run(0xc00013c1c0)
        /src/pkg/handler/spdx.go:88 +0x315
main.generate(0x137e820, {0xb8e5a3, 0x1, 0x1})
        /src/cmd/generator/generator.go:121 +0x373
github.com/spf13/cobra.(*Command).execute(0x137e820, {0xc00001e050, 0x1, 0x1})
        /src/vendor/github.com/spf13/cobra/command.go:856 +0x5f8
github.com/spf13/cobra.(*Command).ExecuteC(0x137e820)
        /src/vendor/github.com/spf13/cobra/command.go:960 +0x3ad
github.com/spf13/cobra.(*Command).Execute(...)
        /src/vendor/github.com/spf13/cobra/command.go:897
main.main()
        /src/cmd/generator/generator.go:39 +0x65

I think this is unrelated to your changes. But take a look at the fix to see if that will solve the issue: #277

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants