Angular Tutorials

Best Way to Update Angular CLI To Latest Version 7 | 8

Today I am going to tell you mostly asked question how to update Angular CLI to version 7 | 8. Currently, Angular 7 version is the latest version, and Angular team releases a new version in every 6 months. To keep your app updated, you must know how to update Angular CLI to the latest version. In this tutorial, I am going to update from Angular version 6 to 7 so let us do it.

How to check Angular CLI version?

Before updating Angular CLI version, we must know which Angular version we are running on our system. This can be done by a very simple command, enter the following command in your terminal.

ng --version

This command will show the installed Angular version in your system.

Update Angular CLI to latest version 7 | 8

Run the following command to install Angular CLI package globally in your machine.

Command for Mac Users

sudo npm uninstall -g angular-cli

For Windows Users

Windows powershell users use below command as an Administrator .

npm uninstall -g angular-cli

This command will will uninstall the angular-cli package globally from your machine.

Then don’t forget to clear the cache using the given below command.

sudo npm cache verify

Use the following command if your NPM version is less than 5.

npm cache clean

You are all set to install the Angular CLI again using the following command.

sudo npm install -g @angular/cli@latest

If any how you are seeing the old version, try the below command.

ng update @angular/cli

It’s time to check out your Angular CLI version, hit the below command.

ng --version

Once you are done updating both global and local packages, use the below command to clear the cache to get rid from the errors.

npm cache verify (recommended)

npm cache clean (use for older npm versions)

How to Update Angular Packages

If you are willing to update the core Angular packakges or dependencies, hit the below command in your terminal.

ng update @angular/core

How to update RxJS?

Use the below command to update RxJS via Angular CLI.

ng update rxjs

I am Digamber, a full-stack developer and fitness aficionado. I created this site to bestow my coding experience with newbie programmers. I love to write on JavaScript, ECMAScript, React, Angular, Vue, Laravel.

Recent Posts

React Redux Handle API Calls with Thunk Middleware Tutorial

In this post, we will learn how to work with HTTP requests in the Redux…

1 day ago

Node AJAX Retrieve Records from MySQL Database Tutorial

MySQL is a relational database management system based on SQL – Structured Query Language, and…

4 days ago

React Manage REST API State Globally with Context API Tutorial

React Js Handle Rest API data globally with Context and useState hook tutorial. In this…

1 week ago

How to Delete Data from MySQL Database using Node Js

Node js delete data from MySQL database tutorial; Throughout this guide, you will ascertain how…

1 week ago

Node Import CSV File Data to MySQL Database with HTML Form

In this tutorial, you will discover how to import CSV file into MySQL database using…

2 weeks ago

How to Handle Global State in React js using Context API

React Js Global state management with createContext hook example; In this tutorial, we will help…

2 weeks ago