Docs/Reference/CLI/why
yarn why
Display the reason why a package is needed
yarn why <PATTERN>
This command prints the exact reasons why a package appears in the dependency tree.
By default, it will print all packages that directly depend on the specified package. If you want to see all transitive paths that lead to the package (going through all workspaces), use the -R,--recursive flag.
Note that the recursive display is optimized to avoid printing the same package subtree multiple times. If you see a package without children in one branch, it means its subtree was already printed elsewhere in the tree.
List all dependency paths from each workspace
Format the output as an NDJSON stream
Also print peer dependencies that match the specified name