Upgrading Angular 7 to Latest Minor Version

 

Goal: Update your Angular packages to the latest minor version.  

This process is simple, and can apply to any npm package.  To do this you need to run npm install followed by the package name, then specify the versions you want to be between.   In my case, I wanted to install the latest Angular 7 without upgrading to Angular 8.  So for the version, I specify less than 8, and greater than or equal to 7.

Example:

syntax: npm install <package-name>@"<version>"

I wanted to upgrade all my angular packages with one line.   First, I removed the packages I wanted to update from the package.json, and ran an npm install so that it removed them. Next I ran the following command:

npm install @angular/animations@">=7 <8", @angular/common@">=7 <8" @angular/compiler@">=7 <8" @angular/core@">=7 <8" @angular/forms@">=7 <8" @angular/http@">=7 <8" @angular/platform-browser@">=7 <8" @angular/platform-browser-dynamic@">=7 <8" @angular/router@">=7 <8"

For development dependencies, --save-dev needs to be added:

npm i --save-dev @angular/cli@">=7 <8" @angular/compiler-cli@">=7 <8" @angular/language-service@">=7 <8"​

I also want to upgrade my development server & typescript so I run this command:

npm i --save-dev @angular-devkit/build-angular@^0.13.0 typescript@~3.2.2

 

That's it.  Now my project's Angular 7 is upgraded to the latest minor version!