Skip to content
Related Articles

Related Articles

How to Install Angularjs on Linux?

View Discussion
Improve Article
Save Article
Like Article
  • Difficulty Level : Basic
  • Last Updated : 09 Nov, 2021

AngularJS as the name suggests is a JavaScript-based framework. Being more precise AngurlarJS is an open-source front-end framework for the web. It is backed and maintained by Google. It has been in the market for a long time now, its initial release dated back to Oct 2010, and its last stable release was 12 months back in Oct 2020. AngularJS aims to be a simple framework for developing mainly single-page web applications by employing MVC & MVVM architecture. Its most popular use cause was to be used as the frontend of the application built with MERM stack.

As of now, everything is well with this framework but there is an announcement made by Google declaring that they will no longer be working on AngularJS to update the framework after December 2021 So after this, all the responsibility of maintaining this framework will entirely be shifted to the opensource community. They also suggested developers to migrate to Angular (v2) which was released in the year 2021 itself. All in all, it is one of the most used frameworks which served its intended purpose well.

Below we will see all the steps related to the installation of AngularJS on the Linux operating system.

Step 1: Update The System

The first and foremost thing that we will do is to update and upgrade all systems so as to avoid any errors in the later steps due to old dependencies. And to do so we will open the terminal app and run the command given below if the operating system is in Ubuntu. If any other Linux-based operating system is being used then you can google the appropriate command.

sudo apt-get upgrade && sudo apt-get update -y

Update The System

Step 2: Install NodeJS

Node JS is a dependency that we require in order to install Angular JS. Node JS is a  cross-platform JavaScript-based runtime environment for the backend. With this developers can write command-line tools and that is exactly what it will be used for in the further steps. First, we will whether NodeJS is already installed in our system or not. And to do so we can check its version by running the below command.

node -v

Install NodeJS

If your system does not already have NodeJS then you will see something like this. And even if NodeJS is already present then you can system then also you can reinstall it to get the latest version.

 Install NodeJS 

To install NodeJs in any Linux is a fairly simple task. All we need to do is to run a command in the terminal. Below we have the command for Ubuntu to install Node JS.

sudo apt install nodejs

install nodejs

To check if NodeJS is installed you can run the command in the first step.

Step 2: Install NPM (Node Package Manager)

Now we will install the node package manager which is required for the installation of Angular CLI. To install the node package manager we need simply need to run the below command in the terminal.

sudo apt install npm -y

install npm

Check NPM Version:

To check the installation of nom we can run the command below which will give out the installed version of npm.

npm -v

Step 3: Install Angular CLI Using NPM

Now that we have installed both NodeJS and NPM we can move on to the installation of Angular CLI which is a command-line tool to work with AngularJS. The command for the installation is given below. All we need to do is simply run it in the terminal.

sudo npm install -g @angular/cli

install angular js

Check The Angular CLI Version:

And to check the proper installation of  Angular CLI we can check its version using the command given below.

ng version

Check The Angular CLI Version

Step 4: Create A Sample Hello World App

The best way to check whether everything is has been installed correctly and is working fine would be to create a sample app; So we will create a hello world app and to do so we need to run the command given below.

ng new helloworld

hello world program

Now we will move to the newly created project folder.

cd helloworld/

Once we are in the project folder we can run the created app by using the command given below.

ng serve

The app will be opened in the browser in the local host whose address will be shown in the terminal.

run angular js server

So this concluded all the steps in order to install AngularJS on Linux-based operating systems and create a sample app. In order to get more information on this topic considers visiting the official website of AngularJS.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!