Angular CLI. Install, create and run a new application

Angular CLI. Install, create and run a new application

In this article, we are going to see how to install Angular globally using CLI using npm package manager. Let's start ...

The current major version of Angular is now 13. So we need to have at least Node.js version 12.20 and npm version 6.14.

Installation

With these installed we are now ready to install Angular. To do this open a terminal or a command window and type

npm install -g angular/cli

The meaning of -g is for global installation that tells you that can use Angular CLI anywhere on your local machine.

Create the application

After the installation completes, you can create a new Angular application with the command ng new my-application, and the CLI will create all necessary files and folders that an Angular application needs to run.

Run the application

With all these in place it's time to run our new application. Just type

cd my-application
ng-serve

Happy coding ...