Skip to content

running cdxgen for repository configured with rush and pnpm package manager throw error #2021

@gkumarcertinia

Description

@gkumarcertinia

Actual Outcomes

Bellow error msg thrown while running cdxgen for repository configured with rush and pnpm package manager.

Image

Expected Outcomes

A complete SBOM report should be generated for this repository.

Additional Context

After analysing it further inside the cdxgen I found the following pieces of source code which causing issue

Image

Actually parsePnpmLock method return JSON object instead of JSON array.

Image

POC

To get this fixed I made the below changes inside the lib/cli/index.js and it's started working.

Image

Though I am not sure if this is the proper fix but it solve the error. So kindly have a look and provide help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions