Standalone Node.js application

node.js

node.js Problem Overview


I am considering developing a desktop application composed of 2 parts:

  • user interface (Java app for example)
  • back-end Node.js server

The 2 parts connect through sockets. Don't ask why I know it's weird.

I will want to be able to provide to customers the application with an installer. I don't want that users have to install Node.js themselves.

Is there a way to have a Node.js server installed as standalone, i.e. no need to install Node.js globally on the system.

This is a question for any (Windows, Linux, Mac OS X...) environment.

node.js Solutions


Solution 1 - node.js

Update 2017-05-04: And there's a new kid in town:

Update 2016-11-14: Nowadays Electron and nwjs seem like the best options.

Original:

There are a number of steps you have to go through to create an installer and it varies for each Operating System. For Example:

Solution 2 - node.js

You can bundle the binaries with your application. Won't have to install anything to run a Node app. The binaries are available on the same page as the installers.

You'll just have to know where the binaries are, but I assume you've got an installer that can put them somewhere known.

// To start the node process
$ /path/to/binaries/npm install
$ /path/to/binaries/node myApp.js

Solution 3 - node.js

Node-Webkit is an option, but it really isn't set-up to do a "server - client" type relationship.

Another option is packaging the node.js installers with you application installer. Then when the application boot you can spin up a node.js process. I know some developers have been doing this with titanium, here is a little bit more information information.

Hope this helps!

Solution 4 - node.js

Here's an option: Light Table is a node app, but installs nicely and integrates the GUI (webkit) cleanly on most OSs.

To do this it leverages node-webkit. (Runs node code straight from an html page.) Here is the packaging documentation.

Solution 5 - node.js

Worth mentioning Electron made by GitHub. Used for building Atom, Slack, Visual Studio Code and more.

Solution 6 - node.js

I’ve just stumbled upon nexe – a tool which “creates a single executable out of your node.js app”.

I haven’t tried it out yet, but I guess that even works without an installer – producing just a single standalone binary.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMatthieu NapoliView Question on Stackoverflow
Solution 1 - node.jscoolaj86View Answer on Stackoverflow
Solution 2 - node.jsBadCanyonView Answer on Stackoverflow
Solution 3 - node.jsSdedelbrockView Answer on Stackoverflow
Solution 4 - node.jsrdreyView Answer on Stackoverflow
Solution 5 - node.jsitamarbView Answer on Stackoverflow
Solution 6 - node.jstomekwiView Answer on Stackoverflow