yarn update package code example

Example 1: yarn update all dependencies to latest

yarn upgrade --latest

Example 2: add dev dependency yarn

yarn add -D package
//or
yarn add --dev package

Example 3: update yarn

# Windows
choco upgrade yarn

# MacOS
brew upgrade yarn

Example 4: yarn add install all packages in package,json

yarn install

Example 5: yarn update a specific package

yarn upgrade
yarn upgrade left-pad
yarn upgrade left-pad@^1.0.0
yarn upgrade left-pad grunt
yarn upgrade @angular

Example 6: install dev dependency yarn

yarn add nameOfPackage --dev