Update Angular CLI And Upgrade Projects from Angular 8/7 to Angular 9

WebTutPro
techiediaries.com
Published in
3 min readJan 22, 2020

--

Angular CLI is a powerful tool at the hand of developers that allows you to quickly initialize and work with Angular projects without the need to deal with complex build tools and configurations that common in modern front-end development these days.

> ✋✋ Join our Facebook group 👈 to discuss anything related to Angular development.

It provides a powerful API and commands that you can actually hook into if you need to customize their functionality but in most cases, the default behavior of these commands is enough.

❤ Use Angular CLI for Boosting your Productivity ❤

After you create your project, you can keep using Angular CLI throughout the development cycle of your web application to boost your productivity by using commands to generate most artifacts such as components, services, pipes, and modules, etc.

🖐 Check out this tutorial 👈

❤ Set up Angular Material and Other Libraries Using Angular CLI ❤

Not just that, you can also use it to set up and configure built-in modules like Angular Material which previously required a bunch of manual steps before it can be configured and used in your project.

❤ Deploy your App with Angular CLI 8.3+ ❤

Starting with version 8.3+ 👏👏👏, you could use the CLI to build and deploy your final application bundles to popular hosting providers like Firebase and GitHub with two quick commands and you can also add support for your own hosting provider either using existing third-party packages or develop your own from scratch.

❤ Upgrade your Project to the Latest Version Using Angular CLI ❤

Finally, you can also use Angular CLI to easily upgrade your project from a previous to a current version.

Angular 9 will be released soon with many new features so for example, if you want to upgrade your project from Angular 8 to Angular 9, you can simply run the ng update command which allows you to update specific versions and dependencies:

What is the ng update Command? 👇👇👇

Ng update is a command available in Angular CLI which is used to update your application and its dependencies. You can use it to update all packages in the package.json file via the --all option that could take true or false or specific versions via the --packages option. You can see all the available commands from the official docs.

Updating Angular CLI to v9 🤔 🤔 🤔

Updating Angular CLI can be made by simply installing the latest version from npm using the following command in your terminal:

$ npm install -g @angular/cli@next

Until Angular 9 is released, you need to use the next tag to install the latest pre-release version.

For a more detailed guide, you can check this tutorial.

How to Upgrade to Angular 9 🤔 😁

For simple use cases and thanks to the work done in Angular, you can upgrade to the latest release using one command:

$ ng update @angular/cli @angular/core

For a step by step example, let’s see how we can update our project from Angular 7/8 to Angular 9.

Wrap-up

Angular CLI is an essential tool for Angular development as it allows you to initialize your project in no time without the need to configure any build tools and systems. It also allows you to generate the various artifacts needed during the development and configure libraries like Angular Material.

Finally, you can also use the tool to deploy your final app to a hosting provider and when a new Angular version is released you can automate many aspects of the upgrade process using the CLI.

Hope this helps you in your web development journey with Angular and if you like it you can clap as much as you want👏👏👏 👍

--

--