Skip to content

Instantly share code, notes, and snippets.

@bbrt3
Last active September 2, 2021 19:16
Show Gist options
  • Save bbrt3/08f3e44041569d0d1853d096a3d8bc38 to your computer and use it in GitHub Desktop.
Save bbrt3/08f3e44041569d0d1853d096a3d8bc38 to your computer and use it in GitHub Desktop.
yarn
yarn add @angular/core
is how we would add dependency to angular/core to our project.
It will update package.json and add dependency (it always gives latest version, like npm install --save !)
yarn add protrator --dev / --peer / --optional
is how we would add dependency to protractor to dev/peer/optionalDependencies part of package.json
yarn global add @angular/cli
is how we would add global dependency
yarn cache clean
will clean your local cached dependencies to make sure you get correct version when installing it again
yarn cache ls
will display what is currently held in our cache
yarn check
checks if dependencies can be upgraded
yarn check --integrity
checks if dependencies are in sync
yarn clean
deletes every dependency of project that was downloaded and gives us info about deleted data.
yarn info @angular/cli
will display info about dependency @angular/cli
yarn info @angular/cli versions
will display all available versions for @angular/cli
yarn init
initializes the package.json file in directory that we currently are.
yarn global ls
will list our global dependencies
yarn list
will list our project dependencies
yarn remove @angular/core
is how we would remove dependency that we no longer need in our project.
yarn run scriptName
is how we would launch a script called scriptName located in our package.json
yarn scriptName would work exactly the same!
yarn add @angular/core@4.0.0
is how we would change the version of @angular/core dependency in our project and set it to 4.0.0.
yarn upgrade @angular/core
is how we would upgrade @angular/core dependency in our project and set it to latest version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment