Man page - npm-ls(1)
Packages contains this manual
- npm-root(1)
- npm-explain(1)
- npm-whoami(1)
- npm-pack(1)
- npm-bugs(1)
- npm-view(1)
- npm-outdated(1)
- npm-update(1)
- npm-query(1)
- npm-logout(1)
- npm-deprecate(1)
- npm-exec(1)
- npm-ping(1)
- npm-shrinkwrap-json(5)
- npm-help(1)
- npm-prefix(1)
- npm-diff(1)
- npm-owner(1)
- npm-install(1)
- npmrc(5)
- npm-uninstall(1)
- npm-hook(1)
- npm-unstar(1)
- npm-docs(1)
- pacote(1)
- npm-restart(1)
- npm-star(1)
- npm-link(1)
- npm-test(1)
- npm-token(1)
- npm-arborist(1)
- npm-profile(1)
- npm-team(1)
- npx(1)
- npm-stars(1)
- npm-adduser(1)
- npm-cache(1)
- npm-edit(1)
- npm-doctor(1)
- npm-help-search(1)
- arborist(1)
- npm-rebuild(1)
- npm-repo(1)
- npm-publish(1)
- npm-start(1)
- npm-unpublish(1)
- npm-dedupe(1)
- npm-init(1)
- npm-dist-tag(1)
- npm-login(1)
- npm-config(1)
- npm(1)
- npm-search(1)
- npm-version(1)
- npm-org(1)
- npm-shrinkwrap(1)
- npm-ls(1)
- package-json(5)
- npm-stop(1)
- npm-install-test(1)
- npm-completion(1)
- npm-run-script(1)
- npm-prune(1)
- npm-access(1)
- npm-ci(1)
- npm-audit(1)
- npm-find-dupes(1)
- npm-install-ci-test(1)
- package-lock-json(5)
- npm-fund(1)
- npm-explore(1)
- npm-pkg(1)
- node-pacote
- node-npmcli-mock-registry
- node-npmcli-node-gyp
- node-libnpmorg
- npm
- node-libnpmteam
- node-npmcli-promise-spawn
- node-libnpmdiff
- node-npmcli-run-script
- node-npmcli-metavuln-calculator
- node-npmcli-smoke-tests
- node-libnpmpublish
- node-qrcode-terminal
- node-npmcli-config
- node-npmcli-git
- node-libnpmaccess
- node-npm-packlist
- node-npmcli-disparity-colors
- node-libnpmexec
- node-npmcli-installed-package-contents
- node-libnpmpack
- node-npmcli-map-workspaces
- node-npmcli-query
- node-npmcli-arborist
- node-npmcli-package-json
- node-libnpmhook
- node-npmcli-name-from-folder
- node-libnpmversion
- node-libnpmfund
- node-libnpmsearch
apt-get install npm
Manual
NPM-LS
NAMESynopsis
Description
Note: Design Changes Pending
Configuration
See Also
NAME
npm-ls
Synopsis
<!-- AUTOGENERATED USAGE DESCRIPTIONS -->
Description
This command
will print to stdout all the versions of packages that are
installed, as well as their dependencies when
--all
is specified, in a
tree structure.
Note: to get a
"bottoms up" view of why a given package is
included in the
tree at all, use
npm explain
.
Positional
arguments are
name@version-range
identifiers, which
will limit
the results to only the paths to the packages named. Note
that nested
packages will
also
show the paths to the specified
packages. For
example, running
npm ls promzard
in npmβs
source tree will show:
npm@@VERSION@ /path/to/npm
βββ¬ init-package-json@0.0.4
βββ promzard@0.1.5
It will print out extraneous, missing, and invalid packages.
If a project
specifies git urls for dependencies these are shown
in parentheses after the
name@version
to make it
easier for users to
recognize potential forks of a project.
The tree shown
is the logical dependency tree, based on package
dependencies, not the physical layout of your
node_modules
folder.
When run as ll or la , it shows extended information by default.
Note: Design Changes Pending
The
npm
ls
commandβs output and behavior made a
ton
of sense when npm
created a
node_modules
folder that naively nested
every dependency. In
such a case, the logical dependency graph and physical tree
of packages on
disk would be roughly identical.
With the advent
of automatic install-time deduplication of dependencies in
npm v3, the
ls
output was modified to display the
logical dependency
graph as a tree structure, since this was more useful to
most users.
However, without using
npm ls -l
, it became
impossible to show
where
a
package was actually installed much of the time!
With the advent
of automatic installation of
peerDependencies
in npm
v7,
this gets even more curious, as
peerDependencies
are
logically
"underneath" their dependents in the dependency
graph, but are always
physically at or above their location on disk.
Also, in the
years since npm got an
ls
command (in version
0.0.2!),
dependency graphs have gotten much larger as a general rule.
Therefore, in
order to avoid dumping an excessive amount of content to the
terminal,
npm ls
now only shows the
top
level
dependencies, unless
--all
is
provided.
A thorough
re-examination of the use cases, intention, behavior, and
output
of this command, is currently underway. Expect significant
changes to at
least the default human-readable
npm ls
output in npm
v8.
Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS -->
See Also
|
β’ |
package spec |
|||
|
β’ |
npm explain |
|||
|
β’ |
npm config |
|||
|
β’ |
npmrc |
|||
|
β’ |
npm folders |
|||
|
β’ |
npm explain |
|||
|
β’ |
npm install |
|||
|
β’ |
npm link |
|||
|
β’ |
npm prune |
|||
|
β’ |
npm outdated |
|||
|
β’ |
npm update |