Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to create an Angular 5 web application without Node.js/npm?

I am trying to create an Angular 5 web application but my boss does not want me to use Node.js/npm. Instead wants me to use Java, is this even possible?

In all of the reading/research I've done, everyone uses Node.js/npm "even the Angular website". So how can I create an application using Java instead of Node.js/npm?

  • If Node.js/npm is NOT needed for Angular 5, why do so many people use it? Wouldn't it bog down their code base? Also how can I use Java to replace Node.js/npm? Are there any additional tools/languages I should know to support the Java/Angular 5 app without Node.js/npm?

  • If Node.js/npm is needed for Angular 5, why? What does it do for the Angular 5 framework that can not be done in Java?

If anyone has an example of an Angular 5 web app using java instead of Node.js/npm I would be much appreciated.

like image 939
Chadillac Avatar asked Nov 27 '17 15:11

Chadillac


People also ask

Can Angular run without NodeJS?

Node js Required to develop angular apps You do not need to use Node anywhere in production server to use front-end JavaScript frameworks like Angular or react etc. We can use any backend webserver technology written in any language (C# ,Java etc.)

Can you use NodeJS without npm?

Yes, it is possible to develop a Node. js application with no NPM registry binaries. This guide aims to give an overview on how to use pure Node. js and its functionalities.

Why do we need npm for Angular?

Let me explain you some of the reasons how node. js makes angular app development process easier for us: Node allows you to spin up a lightweight web server to host your application locally in your system. NPM (Node Package Manager) comes with node.


2 Answers

You can think of Node and NPM as development tools in a sense. Node is a javascript runtime you need to use NPM, and NPM is a package(library in java) manager. You use NPM and the Angular CLI to build an angular app.

I suppose you don't NEED to use node, NPM, and the CLI to make an angular app, but it would be a bit like trying to develop a java app in note pad without having a jvm to test your code.

If you follow best practices developing your angular app ultimately you can use the CLI to build you a production package. That production package is just a bundle of html and javascript files that can be hosted on any server (Tomcat for example)

Angular isn't a library like jQuery that you can just drop on a page and pick out the part that you need, its really its own framework. If you boss wants you to make an angular app he's gonna have to let you use the right tools.

like image 84
Mark D Avatar answered Sep 29 '22 12:09

Mark D


Building an Angular APP without node.js with npm or yarn is not possible. Typically you use the Angular CLI to setup a project and to compile it. And for this you need node, to "build", "develop", "compile or transpile" your angular app. But during the runtime of the application at the browser, you don't need it anymore.

If you want to use maven to trigger the build, you could have a look at the eirslett/frontend-maven-plugin. But there is still node and npm at the background.

And you don't need node.js for the backend services of your application. You could chose Java EE. Here you could look for example at Wildlfy or Payara as an application server.

like image 22
Stefan Großmann Avatar answered Sep 29 '22 10:09

Stefan Großmann