Before entering the installation steps, let’s learn a bit about this framework. Angular combines declarative templates, dependency injection, end-to-end tooling, and integrated best practices to solve development challenges.
Angular empowers developers to build applications that live on the web, mobile, or desktop.
We can work with Angular from our local system after installing Node.js that provides a lightweight server to run this framework. Here, in this article, we will discuss all the steps to install Angular 11 on Ubuntu 20.04.
To continue with this article, the reader must know the basics of working with the Terminal in an Ubuntu system.
What we will learn?
Here in this article, we will learn the following things:-
- Install Node.js on an Ubuntu system
- Updating the NPM
- Installing the Angular CLI.
- Creating a new Angular application
- Running the Angular app we created
We can also opt for the latest version of Nodejs binary distributions before installing this.
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - sudo apt-get install -y nodejs
Node Package Manager(NPM) is needed to install Angular CLI. It will install with the Nodejs itself, but we can update it to the latest version using the below command.
sudo npm install [email protected] -g
Install Angular CLI
Angular CLI helps us to create projects, generate application and library code.
It can simply install using NPM. So open Terminal and install the Angular CLI with the below command.
npm install -g @angular/cli
Creating a New Angular Application
We successfully installed Angular CLI on our system and now we can set up a workspace for Angular projects in our system and create a new app. This can be done with the below command.
ng new awesome-project
Running the Angular App
The ng serve command will run the Angular app we have made.
This launches the server, watches our files, and rebuilds the app as we make changes to those files.
cd awesome-project ng serve --open
The –open or just -o option automatically opens the app in our browser with the below address.
These steps are verified by our team and 100% working. Angular and Ubuntu may release new versions in upcoming years. But these steps remain the same. But we have to look for the latest versions of Node.js and NPM.