yarn info — Yarn CLI reference
Inspect packages in the project dependency tree
yarn info
Inspect packages in the project dependency tree
This command prints information about packages matching the specified patterns.
By default, if the locator reference is missing, Yarn prints information about matching direct dependencies of the package for the active workspace. To instead print all versions of the package that are direct dependencies of any workspace, use the -A,--all flag. Add -R,--recursive to also report transitive dependencies.
Some fields will be hidden by default in order to keep the output readable, but can be selectively displayed by using additional options (--dependents, --manifest, --virtuals, …) described in the option descriptions.
With --virtuals, each instance of a package lists what it gets for its peer dependencies: the package that provides it, ✘ when nothing provides a peer dependency the package requires, and not provided (optional) when nothing provides an optional one. The latter includes the @types package of each peer dependency, which Yarn adds as an optional peer dependency so that the package can use those types when its parent has them.
This command only prints information directly related to selected packages. To understand why a package is installed, use yarn why.
Print versions of a package from the whole project
Print information for all packages, including transitive dependencies
Extra data sections to include
Print information about the cache entry of a package (path, size, checksum)
Print all dependents for each matching package
Print data obtained by looking at the package archive (license, homepage, …)
Only print the name for the matching packages
Print each instance of the virtual packages
Format the output as an NDJSON stream
Examples#
Show information about Lodash
Show the workspaces and packages that depend on Lodash
Show all versions of React used as direct dependencies by any workspace
List the names of all the packages in the project