Yarn Commands
Node.js package manager (Classic and Berry).All Yarn pages
- yarn add --dev: add a devDependency with Yarn (classic and Berry)yarn add --dev (-D) saves a package to devDependencies in Yarn 1 and Yarn 4. Exact and tilde ranges, peer and optional deps, workspaces and Plug'n'Play.
- yarn set version stable: change the Yarn version used by a projectyarn set version stable pins the Yarn release for a project via packageManager and yarnPath. Exact versions, ranges, classic, Corepack and what to commit.
- yarn upgrade a package to the latest version (yarn upgrade --latest, yarn up)Yarn 1 upgrades with yarn upgrade pkg --latest after yarn outdated; Yarn 2+ uses yarn up pkg. Command map for both, ranges, transitive deps and lockfile tips.
- yarn why PACKAGE: find out why a package is installedyarn why lodash shows which dependencies pull a package into node_modules and at which version. Output for Yarn 1 and Yarn 4, plus the npm and pnpm equivalents.