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.
How To Update Angular CLI To Version 7
You can check your current version of Angular CLI using the following command.
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.
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
You can update RxJS using the ng update command:
ng update rxjs
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.
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.
Finally, How To Update Angular CLI To Version 7 Tutorial is over.