Matthieu Napoli Matthieu Napoli - 10 months ago 60
Node.js Question

Standalone Node.js application

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.

Answer Source

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