Skip to content

[BUG] npm ls --all does not list dependency tree without node_modules #3068

@cx-david-moreira

Description

@cx-david-moreira

Current Behavior:

The command npm ls --all does not list the dependency tree, without node_modules folder. This command is failing to list the dependency tree with only the package-lock.json file, using npm v7.

Expected Behavior:

Using npm v6, the npm ls command is working as expected, by listing the dependency tree, with only the package.json and package-lock.json files present, and without node_modules folder.

Steps To Reproduce:

  1. In a project folder with package.json and with package-lock.json files, and without node_modules folder
  2. Run npm ls --all --json

or

  1. In a project folder with package.json
  2. Run npm install
  3. Delete de node_modules folder
  4. Run npm ls --all --json

Environment:

  • OS: Windows 10
  • Node: 14.15.1
  • npm: 7.9.0

or

  • OS: Debian 10
  • Node: 12.13.0
  • npm: 7.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions