How to Install and Set Up Angular 9 on Ubuntu 20.04

Angular is a JavaScript open-source framework that helps in developing single-page web applications suitable for web/mobile/desktop. Here we will learn the steps to install Angular on our Ubuntu system.

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 9 on Ubuntu 20.04.

1. Install Nodejs

Node.js, a JavaScript run-time environment is required to work with Angular. So we must install Nodejs on our system first. The current version of Node.js is 14.2.0. This can be installed on our system by executing the below commands in Terminal.

We can also opt the latest version of Nodejs binary distributions before installing this.

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - sudo apt-get install -y nodejs

2. Update NPM(Optional)

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

3. Install Angular CLI

Angular CLI helps us to create projects, generate application and library code, and perform a variety of ongoing development tasks such as testing, bundling, and deployment.

It can simply install using NPM. So open Terminal and install the Angular CLI with the below command.

npm install -g @angular/cli

4. 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

5. Running Our 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.

http://localhost:4200

Summary

So Angular is one of the trending JavaScript frameworks to build UIs. Also, the open-source Operating System Ubuntu is the best Operating system for developers. So here, we have discussed the steps to install Angular 9 on an Ubuntu 20.04 system. 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.

Have a nice code !

2 thoughts on “How to Install and Set Up Angular 9 on Ubuntu 20.04

  1. sorry but i have problem installing angular/cli

    [email protected]:~$ npm install -g @angular/cli
    npm WARN deprecated [email protected].2: request has been deprecated, see https://github.com/request/request/issues/3142
    npm WARN deprecated [email protected]: this library is no longer supported
    npm WARN checkPermissions Missing write access to /usr/local/lib
    npm ERR! code EACCES
    npm ERR! syscall access
    npm ERR! path /usr/local/lib
    npm ERR! errno -13
    npm ERR! Error: EACCES: permission denied, access ‘/usr/local/lib’
    npm ERR! [Error: EACCES: permission denied, access ‘/usr/local/lib’] {
    npm ERR! errno: -13,
    npm ERR! code: ‘EACCES’,
    npm ERR! syscall: ‘access’,
    npm ERR! path: ‘/usr/local/lib’
    npm ERR! }
    npm ERR!
    npm ERR! The operation was rejected by your operating system.
    npm ERR! It is likely you do not have the permissions to access this file as the current user
    npm ERR!
    npm ERR! If you believe this might be a permissions issue, please double-check the
    npm ERR! permissions of the file and its containing directories, or try running
    npm ERR! the command again as root/Administrator.

    npm ERR! A complete log of this run can be found in:
    npm ERR! /home/p1cire/.npm/_logs/2020-08-23T21_08_06_126Z-debug.log
    [email protected]:~$

  2. problem whit installing angular cli. Error is below

    npm WARN deprecated [email protected].2: request has been deprecated, see https://github.com/request/request/issues/3142
    npm WARN deprecated [email protected]: this library is no longer supported
    npm WARN checkPermissions Missing write access to /usr/lib/node_modules
    npm ERR! code EACCES
    npm ERR! syscall access
    npm ERR! path /usr/lib/node_modules
    npm ERR! errno -13
    npm ERR! Error: EACCES: permission denied, access ‘/usr/lib/node_modules’
    npm ERR! [Error: EACCES: permission denied, access ‘/usr/lib/node_modules’] {
    npm ERR! errno: -13,
    npm ERR! code: ‘EACCES’,
    npm ERR! syscall: ‘access’,
    npm ERR! path: ‘/usr/lib/node_modules’
    npm ERR! }
    npm ERR!
    npm ERR! The operation was rejected by your operating system.
    npm ERR! It is likely you do not have the permissions to access this file as the current user
    npm ERR!
    npm ERR! If you believe this might be a permissions issue, please double-check the
    npm ERR! permissions of the file and its containing directories, or try running
    npm ERR! the command again as root/Administrator.

    npm ERR! A complete log of this run can be found in:
    npm ERR! /home/nee/.npm/_logs/2021-01-03T14_45_19_610Z-debug.log

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.