Skip to content

[BUG] npm ls only listing dev dependencies by default #7917

Open
@sethtomy

Description

@sethtomy

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

When running npm ls INSERT_DEPENDENCY I am only getting back those installation underneath the dev dependencies.

If I run npm ls --prod INSERT_DEPENDENCY then I can see the missing dependency.

Expected Behavior

I would expect that npm ls INSERT_DEPENDENCY by default would list both dev and production dependencies.

Steps To Reproduce

minimal repro

Environment

  • npm: 10.9.0
  • Node.js: 22.11.0
  • OS Name: MacOS
  • System Model Name: MacBook Pro M1
  • npm config:
; copy and paste output from `npm config ls` here
; node bin location = /Users/sethtomy/.nvm/versions/node/v22.11.0/bin/node
; node version = v22.11.0
; npm local prefix = /Users/sethtomy/Developer/open-source/minimal-reproduction-repos/npm-ls-issue
; npm version = 10.9.0
; cwd = /Users/sethtomy/Developer/open-source/minimal-reproduction-repos/npm-ls-issue
; HOME = /Users/sethtomy
; Run `npm config ls -l` to show all defaults.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingPriority 2secondary priority issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions