Angular is a popular open-source web application framework developed by Google and maintained by the community. The language required to create an application using Angular Js is javascript/typescript, and other few mandatory languages require in web development.
Both Mobile and Web applications can easily be created using the angular framework. Angular Js command-line utility helps us quickly create, manage, build, and test Angular applications in your system.
Table of Contents
Installation
The first step is updating and upgrading your repositories and system packages with the latest version.
Step 1: Updating System
The below-mentioned command can update your complete system with new packages and dependencies.
$ sudo apt-get upgrade && sudo apt-get update -y #On Debian and Ubuntu
$ pacman -Syu #On Arch and Manjaro
Step 2: Install Node Js on Linux
The next step is to install Node JS in your system, a javascript-based runtime that provides a command-line interpreter to execute javascript in the console/terminal.
Note: Angular Js require Node Js version of either v12.20, v14.15, or v16.10.
On Debian and Ubuntu
The installation process for Node Js is pretty straightforward. Use the below command to install Node Js v17 on your Debian or Ubuntu system.
$ curl -fsSL https://deb.nodesource.com/setup_17.x | sudo -E bash -
$ sudo apt-get install -y nodejs
On Arch and Manjaro
$ sudo pacman -Sy nodejs
On CentOS, Fedora, and Red Hat Enterprise Linux
Node Js is available to install with DNF package manager for CentOS/Fedora and RHEL.
$ sudo dnf module install nodejs:<steam>
Where the stream corresponds to Node Js major release, use the below command to see the available version of Node Js.
$ dnf module list nodejs
Replace the <stream> with the major release from the output. In my case, it is version 12, as shown below.
$ sudo dnf module install nodejs:12
To verify Node Js is installed, use the below command in your terminal.
$ node -v
Step 3: Install NPM on Linux
Next, you need to install NPM (Node Js Package Manager) to install Angular Js, which comes as Node Js library.
To install npm, use the below command.
$ sudo apt install npm -y #On Debian and Ubuntu
$ sudo pacman -Sy npm #On Arch and Manjaro
$ sudo dnf module install npm #On CentOS/Fedora and RHEL
To verify NPM is installed, use the below command in your terminal.
$ npm -v
Step 4: Install Angular Js on Linux
Now that you have installed Node Js & NPM in your system, you can move forward to establish the Angular Js command-line tool using the Node Js package manager.
Below is the command to install Angular Js on Linux using the node js package manager.
$ sudo npm install -g @angular/cli
Use the below command to verify the Angular Js are correctly installed in your system.
$ ng version
Usage
The best way to check whether everything is working is by creating a simple application. Therefore, we will create a sample application with the project name “helloworld” by executing the below command.
$ ng new helloworld
While creating a new application, may ask a few things like adding angular routing (default: No) and stylesheet format (default: CSS), as shown below.
Now you will move to the newly created directory in your current path using the below command.
$ cd helloworld/
Once you enter the project directory, run the Angular server using the below command.
$ ng serve
Below is the behavior of the above command.
Open the browser and browse http://localhost:4200 with the respective port name (ex: 4200).
Wrap Up
This guide concludes that all-important things require installing Angular Js in major Linux distributions. Please refer to its official site to get more insight into Angular Js command and parameters.
Innovative tech mind with 12 years of experience working as a computer programmer, web developer, and security researcher. Capable of working with a variety of technology and software solutions, and managing databases.