7

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.

4
  • npm is the Node Package Manager, and isn't specific to front- or back-end. NodeJS can be used as a backend, but you can use whatever you want there. If your boss doesn't want you to use npm (for whatever reason) then building much of anything these days will be tough. Commented Nov 27, 2017 at 16:01
  • You mean for the backend? Yes. We do exactly that. But you still need node for the toolchain to compile the front-end. Commented Nov 27, 2017 at 16:01
  • NPM is most used package manger, you can also use other package manager like bower in-place of npm to get the package required for front-end. Commented Nov 27, 2017 at 16:18
  • Mohit Uprim - In that case, couldn't I just download the required Angular 5 packages and put them in my project? If I can't, why not? Commented Nov 27, 2017 at 16:22

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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.

3 Comments

Okay thank you. So to verify, I need Node and NPM for the frontend services when using Angular 5? If so, what do they do for Angular 5 that makes them a necessity?
You need node and npm to "build", "develop", "compile or transpile" your angular app. During runtime of the application at the browser, you don't need it anymore.
node is not like maven in java but node is a language like java . just like spring is a java framework . angular, typescript are node frameworks . and also not sure if ng command can be installed outside npm .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.