Skip to content

[Bug?]: yarn npm audit --json outputs invalid JSON #6406

@marksy

Description

@marksy

Self-service

  • I'd be willing to implement a fix

Describe the bug

Yarn v4 (4.0.1 through to stable, as of writing) where running yarn npm audit --json outputs invalid JSON (Yarn v4.0.0 and v3.x output valid JSON)

To reproduce

https://github.com/marksy/yarn-audit-json-issue

Environment

System:
  OS: macOS 14.5
  CPU: (12) arm64 Apple M2 Max
Binaries:
  Node: 20.12.2 - /private/var/folders/k2/m0m6z1jn77182kybf_6yrql80000gq/T/xfs-beb518a3/node
  Yarn: 4.3.1 - /private/var/folders/k2/m0m6z1jn77182kybf_6yrql80000gq/T/xfs-beb518a3/yarn
  npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleIssues that didn't get attentionwaiting for feedbackWill autoclose in a while unless more data are provided

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions