yarn why
Show information about why a package is installed.
yarn why <query>
This command will identify why a package has been installed, detailing which
other packages depend upon it, for example, or whether it was explicitly marked
as a dependency in the package.json manifest.
yarn why jest
yarn why vx.x.x
[1/4] 🤔 Why do we have the module "jest"...?
[2/4] 🚚 Initializing dependency graph...
[3/4] 🔍 Finding dependency...
[4/4] 🚡 Calculating file sizes...
info Has been hoisted to "jest"
info This module exists because it's specified in "devDependencies".
info Disk size without dependencies: "1.29kB"
info Disk size with unique dependencies: "101.31kB"
info Disk size with transitive dependencies: "20.35MB"
info Amount of shared dependencies: 125
Query argument
The mandatory query argument for yarn why can be any of:
- a package name (as in the above example)
- a package folder; eg:
yarn why node_modules/once - a file within a package folder; eg:
yarn why node_modules/once/once.js
The file locations can also be absolute.
- CLI Introduction
- yarn add
- yarn audit
- yarn autoclean
- yarn bin
- yarn cache
- yarn check
- yarn config
- yarn create
- yarn dedupe
- yarn generate-lock-entry
- yarn global
- yarn help
- yarn import
- yarn info
- yarn init
- yarn install
- yarn licenses
- yarn link
- yarn list
- yarn lockfile
- yarn login
- yarn logout
- yarn outdated
- yarn owner
- yarn pack
- yarn policies
- yarn prune
- yarn publish
- yarn remove
- yarn run
- yarn self-update
- yarn tag
- yarn team
- yarn test
- yarn unlink
- yarn upgrade
- yarn upgrade-interactive
- yarn version
- yarn versions
- yarn workspace
- yarn workspaces
