How To Install Angular And Setup Development Environment

How To Install Angular And Setup Development Environment

In this article we will learn how to install Angular. We install Angular using the Angular CLI, which hides the many complexity of Angular installation. However, before installing Angular, we must first install the NPM Package Manager and choose a Code Editor.

Installing Visual Studio Code:

Visual Studio Code can be downloaded from the following website. The procedure for installation is simple and clear.

Install Package Manager

We will use Node Package Manager, or NPM, to install Angular and its dependencies.

Node Package Manager:

The NPM is a package manager akin to Visual Studio's NuGet. It is the preferred package manager for JavaScript projects. NPM is a package manager that allows you to install libraries, packages, and apps from public sources.

Why is it required?

NPM will be used to install Angular, Typescript, and any additional packages/modules that our application requires. The NPM package manager can be used to upgrade these items as needed. We'd have to manually download and install all of these packages if we didn't have NPM.

NPM Installation:

If NPM is not currently installed on your machine, you must do so. You can use the command prompt to see if the NPM is installed or not.

npm -v

If NPM is installed, the version number will be returned. The NPM is now at version 8.12.1. NodeJS is available for download and installation. NPM comes pre-installed with NodeJS. For instructions and processes, click the installing node.

NPM Configuration:

The Package.json file, which should contain a list of modules/packages used in your application, is required by NPM. The configuration file must contain the entire list of dependencies required by our application.

Once the Package.json file has been produced, we can use the command prompt to install all of the dependencies.

npm install

Installing Typescript:

When we install the Angular CLI, Angular automatically install Typescript.

The Typescript configuration files, tsconfig.json and typings.json, are likewise installed and maintained by Angular CLI.

Installing Angular:

We install Angular using the Angular Command Line Interface (Angular CLI)

The Angular CLI allows us to easily create an Angular application that includes all of the necessary configuration files and packages in a single command. It also makes it easier to add new functionality to existing Angular applications (components, directives, services, and so on).

The Angular CLI leverages Typescript, Webpack (for module bundling), Karma (for unit testing), and Protractor to produce the Angular Application ( for an end to end testing).

Installing Angular CLI:

To install Angular, we use the npm command.

npm i -g @angular/cli@latest

The application above updates your machine to the newest version of Angular CLI. The -g flag (which stands for global) install the Angular CLI system-wide, allowing you to utilize it in all of your projects.

Finding the Angular CLI Version

Using the command, you may find out what version of Angular CLI is currently installed.

ng --version

Conclusion:

In this article, We learn at some of the tools and third-party libraries that are required to construct and execute our Angular application. Let's create our first Angular application in the next article.

I hope this article helps you and you will like it.👍

If you have any doubt or confusion then free to ask in comment section.

Post a Comment

Previous Post Next Post