node js - How do I create build for commercial usage?
Asked Answered
P

2

1

I am working on node js application and it is now ready to use. I want to make exe of this application so that it can be used for commercial usage.

Up to now I have used enclose module using which I have compiled the code of application but I have found some issues in that (app got crash on idle condition). App is running good without enclose or compiled code.

I have searched on google and found some alternate modules like JXcore, Node webkit and Electron etc. but JX core giving error same as in SO question.

In node web-kit, it's functionality is not looking suitable as we need its executable and some dll's along with our code, which makes our package bulky.

I have also tried jxcore. The main problem with the exe's and with modules that we use is their ability to work with native modules, in my case the Kinect.node module. This module cannot be compiled. We need a workaround to package only this along with our .exe file. Enclose provides this workaround in its inbuilt functionality.

Also looking a response from EncloseJS, which is actually run by just one person who gives further instructions upon purchase. A purchase is needed for commercial usage.

In case of Electron, It is supporting only Electron-based application source code. So If I choose this then I have to modify my application code.

So can any one suggest me what can I do to make exe file from node js code there?

Thank you!

Precarious answered 2/1, 2017 at 8:57 Comment(3)
If You need executable so You need to use some framework that understands it's defined structure to compile properly. Of course if You wrote Your webapp and want to ship it as commercial product at least You need some executable that will run in background: node app.js to communicate with it.Comforter
For example let's say Your app runs on 3000 port, has beautiful interface built with bootstrap and etc. But You need executable that will orchestrate all processes. So You can write web browser app (without browser controls) using C# and make it to automatically run nodejs app in bg and after open web browser component and go to localhost:3000Comforter
I was using enclose module of node js which compiles the code and creates executable file (.exe) but that is causing issue. Can you please check here. #41426713Precarious
P
0

I have gotten my answer:

First, reason was DiskDB database, it was not compatible with the node webkit so that is why I was getting error of native modules.

Now I am using sqlite3 module for local database. It is better than DiskDB.

Second, One reason was free version of enclose, Paid version of Enclose JS module ignores the timeout issue which I was getting.

This way I have resolved my question.

Precarious answered 17/1, 2017 at 5:13 Comment(0)
F
3

I had the same issue before, the node js application close when running in background. now i am using process manager2 (pm2), it is working fine and if the application is crash due to any other reason it is automatically started again.

Figurine answered 2/1, 2017 at 9:4 Comment(2)
so would this help in application compiled with enclose module?Precarious
It's funny to use pm2 for desktop app purposes. (:Comforter
P
0

I have gotten my answer:

First, reason was DiskDB database, it was not compatible with the node webkit so that is why I was getting error of native modules.

Now I am using sqlite3 module for local database. It is better than DiskDB.

Second, One reason was free version of enclose, Paid version of Enclose JS module ignores the timeout issue which I was getting.

This way I have resolved my question.

Precarious answered 17/1, 2017 at 5:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.