Install Angular
Written By: Avinash Malhotra
Updated on
How to install Angular?
Angular Installation is not as easy as Angular JS. In Angular JS, all we need to do is to install Angular JS CDN and use ng-app directive in html or any element. But its not in the case of Angular. Angular is a Developer platform built on TypeScript.
To install Angular, First install Node JS. Node JS comes with NPM. NPM is the package manager for node. So we have to use npm to install angular.
Install Angular CLI
Here is the step by step guide to install Angular. Make sure Node Js is already installed in your machine. If not, install nodejs first, and then follow below instructions.
Install Angular in Windows
Install Angular in Mac
Install Angular in Linux
Install Latest version of Angular
Install Specific version of Angular
Check Angular Version
Once Angular is successfully installed, we can cross verify by checking angular version. To check angular version, type following command in terminal or cmd (in windows). This command is common for mac, windows and linux.
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 17.0.1
Node: 18.18.0
Package Manager: npm 9.8.1
OS: darwin x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.1700.1 (cli-only)
@angular-devkit/core 17.0.1 (cli-only)
@angular-devkit/schematics 17.0.1 (cli-only)
@schematics/angular 17.0.1 (cli-only)
Update Angular
In future, if we want to upgrade to latest angular version or degrade to previous version, we have to uninstall current version and install latest version. Here are the steps to update angular
Remove Angular
Clean Cache
Install latest Angular
Angular CLI Commands
Top Angular CLI Commands are given below.
Commend | Meaning |
---|---|
ng build | Compile Angular Application |
ng serve | Build and serve angular application with auto update |
ng generate | generate and modify files |
ng test | Run Unit TEsting on project |
ng e2e | Build and run angular application and run end-to-end tests. |