Skip to content

[BUG] npm ls --long --json does not show license of dependencies #3634

@timhaines

Description

@timhaines

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Running npm ls --long --json does not show the license field in dependencies, if npmv7 was used to install the packages.

npm ls --long --json does show the license field in dependencies if npmv6 was used to install the packages, even when npmv7 is used to run the ls command.

Expected Behavior

Expect to see the license field in the output for dependencies when npm ls --long --json is run.

Steps To Reproduce

  1. Run npm i with npm v7
  2. Run npm ls --long --json with npm v7
  3. Observe licenses field is missing for dependencies.

To observe better behaviour,

  1. Run npm i with npm v6
  2. Run npm ls --long --json with npm v7 (or v6)
  3. Observe licenses field is present for dependencies.

Environment

  • OS: macos
  • Node: v16.5.0
  • npm: 7.20.5

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 2secondary priority issueRelease 8.xwork is associated with a specific npm 8 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions