To build an application that can go live on the web version, desktop or even mobile, installing Angular is important along with other dependencies. In this article, we will help you cover the installation process of Angular on Ubuntu, let’s begin.
For Angularjs installation, Node.js and NPM is required.
Steps to Follow during the installation:
1. Install Node.js
If you don’t it in your system, follow the command given below to add Node.js PPA in your Ubuntu system and further install it.
sudo apt-get install python-software-properties curl -sL https://deb.nodesource.com/setup_12.x | Sudo -E bash - sudo apt-) get install nodejs
To test Node.js installation on the terminal, perform the below command to test the node.
After the installation of the Node.js and NPM, only then you can expect further processing and installation of Angular. So, let’s begin with the actual installation from now:
2. Install Angular/CLI
Install Angular after you have installed Node.js as well as NPM in your system. Use the command given below to install the tool in your system
npm install -g @angular/CLI
The latest Angular version will be downloaded on your system of Ubuntu. In such instances, you may require on your machine the older Angular version. In order to install a specific version of Angular, make sure you follow the command given below:
npm install -g @angular/cli@6 #Angular 6
npm install -g @angular/cli@7 #Angular 7
npm install -g @angular/cli@8 #Angular 8
npm install -g @angular/cli@9 #Angular 9
Here, NPM is node package manager & g stands for installing the Angular CLI tool globally, which makes it accessible for all users & applications on the system.
Points to remember:
Setting up your Angular development environment will require you to configure tools like web pack, typescript, and other dependencies. This can be complex for a newbie in the Angular works. Several other tools can help you avoid the problem, and it can be through Angular CLI, the quickest, finest & easiest tool to manage development, testing, and building processes. It comes with production configuration pre-built and thus has access to a wide range of commands to manage your system.
To verify the installation, make sure you check the version of the Angular which is installed in your system. The checking can be done by using the ng command in Angular CLI.
3. Create a New Angular Application
You can create a new application and the name is “Hello Angular 4” by using the latest Angular tools. To make it work, follow the command given below:
This will then create a directory that would be named as angular-app in the current directory and then create an application.
4. Server Angular Application
After the successful completion of the above steps, your application is all set. Change the directory to angular-app and then run your application using the ng serve command. Only then you can see the difference.
Congratulations, as you have finally installed the @angular/cli without any discomfort. This Angular tutorial is an easy and fun way to make a quick and safe installation. This how you can install Angular on Ubuntu with the 4 steps given above, which are quick and simple. Now that you know the process, do follow it and see the results by yourself.