AppDividend
Latest Code Tutorials

How To Update Angular CLI To Version 7

704

Get real time updates directly on you device, subscribe now.

How To Update Angular CLI To Version 7. Right now, Angular version 7 is the latest version. So, in this article, we will upgrade from Angular 6 to 7. Almost every 6-12 months, a new version of Angular is releasing. So to up to date with the latest version is must needed step. You can find more about Angular CLI on its official documentation.

If you want to learn more about Angular 7 then check out this Angular 7 – The complete Guide course.

How To Update Angular CLI To Version 7

You can check your current version of Angular CLI using the following command.

ng --version

To update the latest angular-cli package installed globally in your system, you need to run the following commands.

sudo npm uninstall -g angular-cli // For Mac

npm uninstall -g angular-cli // For Windows Open Powershell on Administrator Mode

It will uninstall the angular-cli package globally from your computer or server.

Then we need to clear the cache using the following command.

sudo npm cache verify

If your npm version is < 5, then you need to hit the following command.

npm cache clean

Now, install the Angular CLI using the following command.

sudo npm install -g @angular/cli@latest

If your version is still old, then try the following command.

ng update @angular/cli

Now, check your Angular CLI version using the following command.

ng --version

 

How To Update Angular CLI To Version 7

Earn a Tech Degree and get the skills like Frontend Development or Javascript Development that can help you to launch a career. Check out this amazing program

After updating both the global and local package, clear the cache to avoid errors:

npm cache verify (recommended)
npm cache clean (for older npm versions)

#Update Angular Packages

Now you need to update the core packages/dependencies to Angular 7. Just run the following command:

ng update @angular/core

Upgrading RxJS

You can update RxJS using the ng update command:

ng update rxjs

Generating and serving an Angular project via a development server Create and run a new project:

ng new my-project
cd my-project
ng serve

You can see the updated Angular CLI to version 7 by creating the new Angular project.

 

Angular 7 CLI Example Tutorial

Now, at the time of creating a new project, we got the following options, which is new in Angular 7.

At the time of creating the Angular 7 project, we have allowed creating the routing module. So it has the route file in the project folder.

 

Angular 7 Tutorial with Angular CLI

Want to learn to code, gain a new skill and get a new job. Check out this amazing program

Finally, How To Update Angular CLI To Version 7 Tutorial is over.

Related Posts
1 of 16
2 Comments
  1. Jim Showalter says

    I tried to follow these steps, but got:

    npm WARN @ng-bootstrap/ng-bootstrap@3.3.0 requires a peer of @angular/common@^6.1.0 but none is installed. You must install peer dependencies yourself.
    npm WARN @ng-bootstrap/ng-bootstrap@3.3.0 requires a peer of @angular/core@^6.1.0 but none is installed. You must install peer dependencies yourself.
    npm WARN @ng-bootstrap/ng-bootstrap@3.3.0 requires a peer of @angular/forms@^6.1.0 but none is installed. You must install peer dependencies yourself.
    npm WARN @ngtools/webpack@6.2.4 requires a peer of typescript@~2.4.0 || ~2.5.0 || ~2.6.0 || ~2.7.0 || ~2.8.0 || ~2.9.0 but none is installed. You must install peer dependencies yourself.
    npm WARN codelyzer@4.3.0 requires a peer of @angular/compiler@>=2.3.1 6.0.0-beta =2.3.1 6.0.0-beta ng update @ng-bootstrap/ng-bootstrap
    Package “@ng-bootstrap/ng-bootstrap” has an incompatible peer dependency to “@angular/common” (requires “^6.1.0”, would install “7.0.0”)
    Incompatible peer dependencies found. See above.

    1. Genti says

      Jim just do a npm install @ng-bootstrap/ng-bootstrap@latest, this commands installs the latest version of ng-bootstrap which will be compatible with Angular 7

Leave A Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.