Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Node.js required for Angular?

Why is Node.js required in order to use Angular?

In other posts, people say that it isn't required, and that it's only needed if you want server-side code. But the Angular documentation specifically states the need for Node.js in the "Getting Started" section. Why exactly is Node.js required? What if I want to use .NET Core as my server side back-end?

Straight from the Angular site:

Prerequisites before you begin, make sure your development environment includes Node.js® and an npm package manager.

Node.js Angular requires Node.js version 8.x or 10.x.

To check your version, run node -v in a terminal/console window.

To get Node.js, go to nodejs.org.

like image 659
user1431072 Avatar asked May 21 '19 03:05

user1431072


Video Answer


1 Answers

Angular does not need Node.js directly and it is not mandatory to use Node.js. But you will need Node.js for all the build and development tools.

For an example these are few reasons that you need Node.js for building an Angular app,

  • npm (node package manager) comes with Node.js by default and it allows you to manage your dependencies. So, you don’t have to worry for operations like adding a dependency, removing some, updating your package.json.

  • npm gives you angular cli or ng cli (angular command-line interface) which is a great tool for building your application easily

  • Node.js allows you to spin up a lightweight web server to host your application locally in your system.

like image 99
Sandeepa Avatar answered Oct 21 '22 04:10

Sandeepa