Yarn
Install Yarn
brew install yarnSwitch yarn to specific version / latest version (yarn 1.x)
yarn policies set-version <version>
yarn policies set-versionSwitch yarn to specific version / latest version (yarn 2.x)
yarn set version <version>
yarn set version latestInformation
Show yarn version and help
yarn -v
yarn helpShow information for a package
yarn info <package>Show why a package was installed
yarn why <package>List
List installed packages (local / global)
yarn list
yarn global listList only top level global packages
yarn list --depth=0
yarn global list --depth=0List packages that match pattern
yarn list --pattern <string>Init
Initialize package config in current folder (-y or --yes for default setup)
yarn init
yarn init --yesGenerate new yarn lock file from installed packages
yarn importInstall
Install all configured package.json dependencies (dev and production)
yarn installInstall new dev (-D), peer (-P), optional (-O) package
yarn add <package>
yarn add <package>@<version>
yarn add <package> --devGlobal packages
yarn global add <package>Uninstall
Uninstall package (local, dev, global)
yarn remove <package>
yarn remove <package> --dev
yarn global remove <package>Upgrade
Upgrade packages or specific package (local, global) for current major
yarn upgrade
yarn upgrade <package>
yarn global upgrade <package>Upgrade packages or specific package to latest version regardless of package.json version ranges
yarn upgrade --latest
yarn upgrade -L
yarn upgrade -L <package>Show outdated packages where new version exists
yarn outdated
yarn outdated <package>Scripts
Run scripts from package.json
yarn run <script-name>Check
Check configured dependencies match lock file
yarn checkGlobal Packages and Cache
Show location of global packages folder
yarn global binShow direction of global cache
yarn cache dirList all or matching packages in global cache
yarn cache list
yarn cache list --pattern <string>Clear the global cache
yarn cache cleanConfiguration
Display the current configuration
yarn config listSet configuration values
yarn config set <key> <value>Get configuration value
yarn config get <key>Delete configuration value
yarn config delete <key>Last updated