How To Install AngularJS on AlmaLinux 9
In this tutorial, we will show you how to install AngularJS on AlmaLinux 9. For those of you who didn’t know, AngularJS is a JavaScript-based open-source front-end web application framework that assists with running single-page applications. It was developed in 2009 by Google to help developers design complex applications from scratch without having expert knowledge of coding languages like C# or Java.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of the AngularJS on AlmaLinux 9. You can follow the same instructions for CentOS and Rocky Linux.
Prerequisites
- A server running one of the following operating systems: AlmaLinux 9.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install AngularJS on AlmaLinux 9
Step 1. First, let’s start by ensuring your system is up-to-date.
sudo dnf clean all sudo dnf update
Step 2. Installing Node.js on AlmaLinux 9.
By default, Node.js is available on the AlmaLinux 9 base repository. Now, checklist the available Nodejs streams by running the following command:
sudo dnf module list nodejs
Output:
AlmaLinux 9 - AppStream Name Stream Profiles Summary nodejs 10 [d] common [d], development, minimal, s2i Javascript runtime nodejs 12 common [d], development, minimal, s2i Javascript runtime nodejs 14 common [d], development, minimal, s2i Javascript runtime nodejs 16 common [d], development, minimal, s2i Javascript runtime Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
From the above output, Node.js version 10 is the default. To install another latest version, we need to enable and install it using this command below:
sudo dnf module enable nodejs:16 sudo dnf install nodejs
Finally, verify Node.js and NPM versions using this command:
$ node -v v16.15.1
For npm:
$ npm -v 8.13.1
Step 3. Installing AngularJS on AlmaLinux 9.
By default, AngularJS is not available on the AlmaLinux 9 base repository. Simply run the following command below to install Angular CLI to your AlmaLinux system:
sudo npm install -g @angular/cli
Verify the AngularJS version installed once the installation is complete:
ng version
Output:
[root@idroot ~]# ng --version Angular CLI: 14.0.3 Node: 16.15.1 Package Manager: npm 8.13.1 OS: linux x64 Angular: ... Package Version ------------------------------------------------------ @angular-devkit/architect 0.1400.3 (cli-only) @angular-devkit/core 14.0.3 (cli-only) @angular-devkit/schematics 14.0.3 (cli-only) @schematics/angular 14.0.3 (cli-only)
Step 4. Create Sample Angular Application.
You may use the ng
command to create a new AngularJS application:
ng new MyApplication
Next, change into the newly created MyApplication
directory with the following command below:
cd MyApplication
Serve up the new application with the command:
ng serve --host 0.0.0.0
Once the create a sample project, you can now access it on the URL from your browser:
http://your-server-ip-address:4200
Congratulations! You have successfully installed AngularJS. Thanks for using this tutorial for installing AngularJS JavaScript MVW Framework on your AlmaLinux 9 system. For additional help or useful information, we recommend you check the official AngularJS website.