Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Standalone Node.js application

Tags:

node.js

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.

like image 780
Matthieu Napoli Avatar asked Nov 14 '12 21:11

Matthieu Napoli


People also ask

CAN Node.js work without Internet?

therefore no connection needed.

Is Node.js good for real-time applications?

Node. js is best suited for handling concurrent connections, making it an excellent framework to develop real-time as well as multi-user web apps.

CAN node run 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.

Does Node.js use MVC?

MVC is an acronym for Model-View-Controller. It is a design pattern for software projects. It is used majorly by Node developers and by C#, Ruby, PHP framework users too. In MVC pattern, application and its development are divided into three interconnected parts.


2 Answers

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

  • PKG (by zeit)

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

  • Electron
  • nwjs-builder

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:

  • on Mac OS X you need to create a .pkg, there are instructions on how to do that here: https://coolaj86.com/articles/how-to-create-an-osx-pkg-installer.html
  • on Ubuntu Linux you need to create a .deb, there are instruction on how to do that here: https://coolaj86.com/articles/how-to-create-a-debian-installer.html
  • on Microsoft Windows you need to create a .exe or .msi, there are instruction on how do that using the innosetup installer here: https://coolaj86.com/articles/how-to-create-an-innosetup-installer.html
like image 197
coolaj86 Avatar answered Oct 05 '22 22:10

coolaj86


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 
like image 24
BadCanyon Avatar answered Oct 05 '22 22:10

BadCanyon