How to install AngularCLI on Debian 11?

If we are talking about Javascript then it is very likely that we will also find AngularJS somewhere. Today, in this post, you will learn how to install AngularCLI on Debian 11, and with this tool, you will be able to create AngularJS projects smoothly and quickly.

What is AngularJS?

AngularJS is an awesome open-source javascript framework developed by Google for dynamic web apps. It is focused on the development of single-page web applications and is developed in TypeScript. Many developers claim that it is very easy to develop a frontend with Angular.

One of the reasons why Angular is so popular is that it is a framework that allows you to build robust web applications and can be very useful for building SPA (single-page application). Also, it is modular, so it is based on a core and modules that allow access to more features when needed.

Angular applications depend on features and functionality provided by libraries such as NodeJS, which is a requirement for Angular to be installed.

Many developers claim that Angular 5 makes it easy to share application states between what is on the server side and what is on the client-side of the application. So data integration is guaranteed.

To use Angular, we have a tool called AngularCLI. AngularCLI is the standard command-line tool for creating, debugging, and publishing Angular applications. So to make our life easier, we have to install AngularCLI.

So, let’s get started.

Install AngularCLI on Debian 11

The main requirement to install this tool is to install NodeJS. So let’s go for it.

Install NodeJS on Debian 11

So, open a terminal in your GUI or connect via SSH to your server.

After that, update it.

sudo apt update
sudo apt upgrade

Next, we have to add the corresponding NodeJS 14 repository.

curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -

After thart, you can install NodeJS.

sudo apt install nodejs

With this, both NodeJS are ready to install AngularCLI..

Install AngularCLI on Debian 11

With NodeJS successfully installed, we can then install AngularCLI by running the following command

sudo npm install -g @angular/cli

Sample Output:

+ @angular/[email protected]
+ added 236 packages from 183 contributors in 25.041s

Now create a new AngularCLI project like this

ng new [project-name]

Sample Output:

? Would you like to add Angular routing? No
? Which stylesheet format would you like to use?

Packages installed successfully.

In my case, I have created a test project called example. During the installation process, then you will be asked some questions regarding Angular.

Access the folder created with the name of the project.

cd example 

And there will be all the structure of the project.

To test everything, run

ng serve

There it will be available on localhost but you can also specify the host and port.

ng serve --host [host_ip] --port [port] 

Next, open a web browser, and at the address given in the previous command, you will see the following

Angular on Debian 11
Angular on Debian 11

So, AngularCLI will be ready and Angular will be ready for work.

Conclusion

In this post, we have helped you with AngularCLI and its installation process. This is quite simple to do and thanks to it, you will be able to create an Angular project without any problems.

Scroll to Top