Angular is a JavaScript open-source framework which helps in developing single-page web applications suitable for web/mobile/desktop. Angular supports the use of TypeScript instead of JavaScript in our project if we are familiar with it.
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 the desktop.
The current stable version of Angular is 7.2.13 and we are going to explain the steps of installation of it on Ubuntu 18.04.1 LTS Bionic Beaver operating system.
1. INSTALL NODEJS
Because Angular is a JavaScript framework, it requires to have Nodejs(A JavaScript runtime) installed on our system.
11.13.0 is the current latest version and it can be installed by running the command below on our Terminal.
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash - sudo apt-get install -y nodejs
2. UPDATE NPM(OPTIONAL)
Node Package Manager(NPM) is automatically installed with the installation of Nodejs. But if we need to update it to the latest version, use the command below.
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 be simply installed using npm.
npm install -g @angular/cli
4. CREATE A NEW ANGULAR PROJECT
Now we need to set up a workspace for Angular projects in our system and create a new app.
ng new awesome-project
5. RUNNING OUR APPLICATION
The app we created can be run using the command below.
cd awesome-project ng serve --open
This opens up a new tab on our browser with the URL below.
http://localhost:4200
d
says:> sudo npm install [email protected] -g
Do not use sudo for that…
Even better create a new user just for npm
Syamlal CM
says:Thanks for the heads up.
simon o'gorman
says:Okay but now I need to use sudo to use npm. Is there something I’m missing.
Syamlal CM
says:This looks like a permissions issue in your home directory. To reclaim ownership of the .npm directory execute:
sudo chown -R $(whoami) ~/.npm
machoMan
says:please post more in detail