Standalone Node.js application

后端 未结 7 612
伪装坚强ぢ
伪装坚强ぢ 2020-11-29 18:55

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

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

Th

相关标签:
7条回答
  • 2020-11-29 19:22

    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
    0 讨论(0)
  • 2020-11-29 19:23

    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
    
    0 讨论(0)
  • 2020-11-29 19:26

    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!

    0 讨论(0)
  • 2020-11-29 19:30

    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.

    0 讨论(0)
  • 2020-11-29 19:33

    I got here searching for Node.js desktop app framework (even though the question by OP about installing node.js server as a package, not about app with UI).

    I'd like to mention Proton Native as it is missing here so far. It is still new, but looks promising. It lets you use React Native components to create desktop apps for various platforms (uses Qt under the hood).

    0 讨论(0)
  • 2020-11-29 19:35

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

    0 讨论(0)
提交回复
热议问题