Installing Angular CLI on Ubuntu

Vishal Sharma
2 min readDec 5, 2019

--

The Angular CLI is a command-line interface tool that you use to initialize, develop, and maintain Angular applications.

Installing Angular CLI:

We can install Angular CLI in many ways. In this section, we will be using NPM (Node Package Manager) on Ubuntu. We use the following commands to install Angular CLI.

sudo apt update
sudo apt install nodejs

The nodejs package contains both the node and npm binaries.

Now, we will check the node and npm version

sudo node --version
v12.13.1
sudo npm --version
6.12.1

If the npm version is old then we can update using the following commands.

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

Now, let’s start Angular CLI using npm.

sudo npm install -g @angular/clisudo ng --version

Now, let’s add a test project using Angular CLI.

ng new my-fisrt-project

This will configure our first Angular project in “my-first-project” directory.

Now, we’ll start our project using the following commands.

cd my-first-project
ng serve --open

Now, open the browser on http://localhost:4200/ to check the running project.

We can follow the next steps to build for production environments, add dependencies and perform other actions.

--

--

Vishal Sharma

IT Enthusiast, Professional, Novice Sportsperson and Fantasist of Better World. @byVishalSharma on Twitter.