Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
sethtomy opened this issue Nov 18, 2024 · 6 comments
Open
2 tasks done

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

sethtomy opened this issue Nov 18, 2024 · 6 comments
Labels
Bug thing that needs fixing Priority 2 secondary priority issue

Comments

@sethtomy
Copy link

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.
@sethtomy sethtomy added Bug thing that needs fixing Needs Triage needs review for next steps labels Nov 18, 2024
@sethtomy sethtomy changed the title [BUG] nom ls only listing dev dependencies by default [BUG] npm ls only listing dev dependencies by default Nov 18, 2024
@ljharb
Copy link
Contributor

ljharb commented Nov 18, 2024

What about npm explain cross-spawn? That may be more helpful.

@sethtomy
Copy link
Author

What about npm explain cross-spawn? That may be more helpful.

It's definitely an alternative option. Perhaps this is just a documentation issue? My thought process is that running "npm install" installs both dev and production dependencies so I'd expect "npm ls" to be consistent.

@kchindam-infy
Copy link

@sethtomy I tried the npm ls and all the dependencies and devDependencies are listed as expected. If you still think this is an issue, please provide more details to troubleshoot.

@sethtomy
Copy link
Author

sethtomy commented Dec 2, 2024

@kchindam-infy thanks for looking! Did you use my minimal reproduction repo? I put a link in the issue.

@kchindam-infy
Copy link

@sethtomy
image

@sethtomy
Copy link
Author

sethtomy commented Dec 5, 2024

@kchindam-infy can you run the below and see the output? This is the issue I'm facing.

npm ls cross-spawn
# ├─┬ @nestjs/[email protected]
# │ └─┬ [email protected]
# │   └─┬ [email protected]
# │     └── [email protected] deduped
# ├─┬ [email protected]
# │ └── [email protected]
# └─┬ [email protected]
#   └─┬ @jest/[email protected]
#     └─┬ [email protected]
#       └─┬ [email protected]
#         └── [email protected] deduped

@kchindam-infy kchindam-infy added Priority 2 secondary priority issue and removed Needs Triage needs review for next steps labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 2 secondary priority issue
Projects
None yet
Development

No branches or pull requests

3 participants