Yarn Package Manager Cheat Sheet
by Greg Finzer (GregFinzer) via cheatography.com/15280/cs/11442/
Links
Install Yarn https://yarnpkg.com/en/docs/install
Documentation https://yarnpkg.com/en/docs
Get version of Yarn Installed yarn --version
Migrating from npm
Run first in your project directory on the command line. yarn
Change Angular CLI to use yarn ng set --global packageManager=yarn
Install Packages
Install a package, update the package.json and yarn.lock files yarn add <package-name>
Install a specific version of a package, update the package.json and yarn.lock files yarn add <package-name>@<version-number>
Install to dev dependencies yarn add <package-name> --dev
Install a package globally yarn global add <package-name>
Get the global cache directory yarn cache dir
Restore Packages defined in package.json yarn install
Uninstall Packages
Uninstall, remove from package.json, remove from yarn.lock yarn remove <package-name>
Uninstall a global package yarn global remove <package-name>
Clean from the yarn cache yarn cache clean
List Packages
List packages used by your application with no dependencies yarn list --depth 0
List packages used by your application with dependencies yarn list
List packages installed globally yarn global ls
Get info about a package yarn info <package-name>
Why is a package needed? yarn why <package-name>
Verify Packages
Verify package dependencies yarn check
Verify package check sums yarn check --integrity
Upgrading Packages
Show outdated packages yarn outdated
Upgrade a package to the latest version yarn upgrade <package-name>
Upgrade a package to a specific version yarn upgrade <package-name>@<version-number>
Upgrade a global package yarn global upgrade <package-name>
By Greg Finzer (GregFinzer) Published 13th April, 2017. Sponsored by CrosswordCheats.com
cheatography.com/gregfinzer/ Last updated 9th June, 2017. Learn to solve cryptic crosswords!
www.kellermansoftware.com Page 1 of 2. http://crosswordcheats.com
Yarn Package Manager Cheat Sheet
by Greg Finzer (GregFinzer) via cheatography.com/15280/cs/11442/
Proxy - escape special characters
yarn config set proxy http://username:password@yourproxyserver:8080/
yarn config set https-proxy http://username:password@yourproxyserver:8080/
By Greg Finzer (GregFinzer) Published 13th April, 2017. Sponsored by CrosswordCheats.com
cheatography.com/gregfinzer/ Last updated 9th June, 2017. Learn to solve cryptic crosswords!
www.kellermansoftware.com Page 2 of 2. http://crosswordcheats.com