Angular Installation via NodeJs

Angular Installation via NodeJs

You'll need the following to install Angular on your local system:

Node.js: An active LTS or maintenance LTS version of Node.js is required for Angular. Run node -v in a terminal window to see what version of Node.js is installed on your machine.

npm package manager:

For many features and functions, Angular, Angular CLI, and Angular applications rely on npm packages. An npm package manager is required to download and install npm packages. This tutorial uses the npm client command-line interface, pre-installed with Node.js. Run npm -v in a terminal window to see if the npm client is installed.

Angular Installation via NodeJs

With Angular CLI, you may create the projects, generate library codes and applications, and perform ongoing development tasks like bundling, testing, and deployment.

Open a terminal window and type the following command to instal the Angular CLI:

npm install -g @angular/cli

Make a workspace and a start-up application

In the context of an Angular workspace, you create apps. To make a new workspace and an initial beginning app, follow these steps:

Use the CLI command ng new to create a new application with the name my-app, as demonstrated here:

ng new my-app

The ng new command asks for details about the features you want to include in the first app. By using the Enter or Return key, you accept the defaults.

Run the application

  • You can create and serve your app locally using Angular CLI's server.
  • Go to the workspace folder, for example, my-app.

Execute the command below:

cd my-app.

ng serve --open.