Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why there is a dependency to install NodeJs for a .Net core web application which uses angular template?

When I create a new .NET core web application in visual studio using angular template and try to run the barebone application, build error is thrown asking to install nodeJs. After studying that angular is totally a different package from NodeJs, why is this project has dependency on nodejs installation ?

Problem solved after installing nodejs, but not sure why nodejs is a dependency here.

FYI, I am relatively new to angular.

like image 398
HarryPotter Avatar asked Nov 02 '25 03:11

HarryPotter


2 Answers

  • Typescript used by angular cant be understood by browers, so you need to transpile the code to javascript for make them work. The typescript transpiler for converting typescript to javascript requires nodejs.
  • NPM package mangager which helps in managing your project dependencies comes by default with nodejs
like image 101
Ameerudheen.K Avatar answered Nov 03 '25 19:11

Ameerudheen.K


As Ameer Pappay mentioned, NodeJs is needed to transpile typescript into javascript and for other development tools that you might need while you develop your application. But once you create a distribution build, it can be served through any web server and will not require a NodeJs instance.

like image 42
Elias N Avatar answered Nov 03 '25 18:11

Elias N



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!