Angular update/upgrade

Install Angular CLI globally:

npm install -g @angular/cli

Update Angular via CLI:

ng update @angular/cli @angular/core --allow-dirty --force

Update Angular Material via CLI:

ng update @angular/cdk @angular/material --allow-dirty --force

Update rxjs, tslib, zone.js via CLI:

ng update rxjs tslib zone.js
  • --allow-dirty flag skips the repo check and does not throw "Repository is not clean" error
  • --force flag force the update if something is still throwing an error

Update Angular via cli to a specific version:

ng update @angular/cli@^10 @angular/core@^10

Install Angular Material:

npm install --save @angular/material @angular/cdk

Show outdated libraries:

npm outdated

Install latest Bootstrap:

npm install bootstrap@latest --save

Update Bootstrap to specific verion:

npm install bootstrap@5.0.0-alpha3 --save

Leave a Comment