How to Install the Angular CLI

To install the Angular CLI, you need to follow the steps given below:

  1. Install Node.js: Angular CLI is built on top of Node.js, so you need to install Node.js first. You can download the latest version of Node.js from the official website https://nodejs.org/en/download/. Follow the instructions for your operating system to install Node.js.
  2. Verify Node.js installation: To verify that Node.js is installed correctly, open a command prompt or terminal and run the following command:
node -v

This should print the version number of Node.js installed on your system.

  1. Install the Angular CLI: After installing Node.js, open a command prompt or terminal and run the following command to install the Angular CLI globally:
npm install -g @angular/cli

This will install the latest version of Angular CLI globally on your system.

  1. Verify Angular CLI installation: To verify that Angular CLI is installed correctly, open a command prompt or terminal and run the following command:
ng version

This should print the version number of Angular CLI installed on your system along with the version numbers of other dependencies.

That’s it! You have successfully installed the Angular CLI on your system. You can now use it to create, build, and test Angular applications.