[BUG] npm ls --depth=Infinity returns dev dependencies of local prod dependencies #3593
Closed
1 task done
Labels
Bug
thing that needs fixing
Needs Triage
needs review for next steps
Release 7.x
work is associated with a specific npm 7 release
Is there an existing issue for this?
Current Behavior
If there is a prod dependency installed from the local filesystem and it has dev dependencies,
npm ls --depth=Infinity
returns also dev dependencies although it doesn't do this for dependencies installed from the public NPM registry. Depth parameter value doesn't matter - it just has to be more than 0.It worked fine in npm v6.
Expected Behavior
All dev dependencies except direct ones (depth=0) should not be listed when calling
npm ls --depth=Infinity
Steps To Reproduce
npm install
npm ls --depth=Infitnity
My example
Package.json:


npm ls result:
Explanation: all packages ending with "X" in the name are dev dependencies and they shouldn't be listed the same way as dev dependencies of "adm-zip" package aren't. The "x" package is a dev dependency but it's a direct dependency of the module so it should (and is, correctly) be listed.
adm-zip's package.json file from node_modules (an evidence that is has dev dependencies and they weren't listed):

Environment
The text was updated successfully, but these errors were encountered: