versioned_docs/version-10.x/cli/list.md
Aliases: ls
This command will output all the versions of packages that are installed, as well as their dependencies, in a tree-structure.
Positional arguments are name-pattern@version-range identifiers, which will
limit the results to only the packages named. For example,
pnpm list "babel-*" "eslint-*" semver@5.
Perform command on every package in subdirectories or on every workspace package, when executed inside a workspace.
Log output in JSON format.
Show extended information.
Added in: v10.23.0
Read package information from the lockfile instead of checking the actual node_modules directory. This is useful for quickly inspecting what would be installed without requiring a full installation.
Outputs package directories in a parseable format instead of their tree view.
List packages in the global install directory instead of in the current project.
Max display depth of the dependency tree.
pnpm ls --depth 0 (default) will list direct dependencies only.
pnpm ls --depth -1 will list projects only. Useful inside a workspace when
used with the -r option.
pnpm ls --depth Infinity will list all dependencies regardless of depth.
Display only the dependency graph for packages in dependencies and
optionalDependencies.
Display only the dependency graph for packages in devDependencies.
Don't display packages from optionalDependencies.
Display only dependencies that are also projects within the workspace.
Exclude peer dependencies from the results (but dependencies of peer dependencies are not ignored).
import FindBy from '../settings/_findBy.mdx'
<FindBy />