Wednesday, 12 June 2019

How To Update Angular CLI To Version 8 | Angular 8 CLI Upgrade

How To Update Angular CLI To Version 8 | Angular 8 CLI Upgrade is today’s topic. Right now according to this post’s date, the Angular version 8 is the latest version. So, in this article, we will upgrade from Angular 7 to 8. Almost every 6-12 months, a new version of Angular is releasing. So to up to date with the latest version. You can find more about Angular CLI on its official documentation. You can see the features and upgrades of Angular 8.

How To Update Angular CLI To Version 8

You can check your current version of Angular CLI using the following command.
ng --version
See the following output.
How To Update Angular CLI To Version 8
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
Then we need to clear the cache using the following command.
sudo npm cache verify

sudo npm cache verify
Then you need to hit the following command.
sudo npm cache clean
 Now, install the Angular CLI using the following command.
sudo npm install -g @angular/cli@latest

Angular 8 CLI
See, I have installed the Angular 8 CLI.
Now, check your Angular CLI version using the following command.
Angular 8 CLI Upgrade Example

After updating both the global and local package, clear the cache to avoid errors.
sudo npm cache verify
npm cache clean (for older npm versions)

#Update Angular Packages

If you have created an Angular project then go inside that folder and type 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 angular8demo
cd angular8demo
ng serve
If you are facing any npm install: Unhandled rejection Error: EACCES: permission denied error then please try the following command.
sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config
Now, see the newly installed Angular 8 project.
Angular CLI Installation
You can see the updated Angular CLI to version 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 8.
At the time of creating the Angular 8 project, we have not for allowed creating the routing module. See the following project structure.
Angular 8 Project Structure

Finally, How To Update Angular CLI To Version 8 | Angular 8 CLI Upgrade article is over.

No comments:

Post a Comment