How to install the Angular JavaScript framework on AlmaLinux

Your business needs either a web or mobile app. To make that happen, you should have Angular available for your developers. Jack Wallen shows you how to install this popular framework.

female-developer-at-computer.jpg

Image: iStock

Angular is one of the most popular JavaScript frameworks on the planet. In fact, according to Two Sigma Ventures' Open Source Index, Angular ranks #9 on GitHub. With Angular, your company can quickly build and deploy web applications and mobile apps. If your company is serious about remaining competitive in an increasingly competitive world, you're going to need to consider web applications and/or mobile apps as a part of your strategy.

Ergo, you should consider adding the Angular JavaScript framework as a part of your development toolkit.

Your developers might isolate their work to their workstations, or you might have them logging into specific servers in your data center (to keep things centralized). Either way, I want to show you how to install Angular on the 1:1 binary replacement for Red Hat Enterprise Linux, AlmaLinux. Once this is installed, your developers can log in to the server and start creating incredible web and mobile apps for your business.

SEE: The best programming languages to learn--and the worst (TechRepublic Premium)

What you'll need

  • A running instance of AlmaLinux

  • A user with sudo privileges

How to install Angular on AlmaLinux

Log in to your AlmaLinux server and first install git with the command:

sudo dnf install git -y

Once git is installed, select the module stream for Node.js you want to use (either 10 or 12) with the command:

sudo dnf module enable nodejs:X

Where X is either 10 or 12 (the default is 10).

Install Node.js with the command:

sudo dnf install nodejs -y

With Node.js installed, it's time to install Angular with the command:

sudo npm install -g @angular/cli

When the above installation completes, verify the installation with the command:

ng --version

You should see the version of Angular installed, as well as several other packages (Figure A).

Figure A

angulara.jpg

Angular is installed and ready for action.

How to run the Hello World! application

We all love a good Hello World! demonstration. Let's do that with Angular. To create the Hello World! application with Angular, issue the command:

ng new hello-world

Answer the questions with the defaults and you will be dropped back to the bash prompt. Change into the newly created hello-world directory with the command:

cd hello-world

Serve up the new application with the command:

ng serve --host SERVER --port 4200

Where SERVER is the IP address of the hosting server.

Once the application is being served (it'll take a minute or two to complete this step), open a web browser and point it to http://SERVER:4200 (where SERVER is the IP address of your hosting server) (Figure B). 

Figure B

angularb.jpg

Our Hello World! application has been successfully served by Angular.

Congratulations, you now have Angular ready for your developers to make use of. Have them log in to the server and begin developing your company's ideal web or mobile application, with the help of this popular framework.

Subscribe to TechRepublic's How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.

Also see

By Jack Wallen

Jack Wallen is an award-winning writer for TechRepublic, The New Stack, and Linux New Media. He's covered a variety of topics for over twenty years and is an avid promoter of open source. For more news about Jack Wallen, visit his website jackwallen....