Can I make Node.JS app self executable? [duplicate]

孤街浪徒 提交于 2019-12-12 06:08:16

问题


I'm a Node.JS beginner, so please forgive me if my question is too naive or too simple:) I made myself a simple node.js app: index.js which requires my_module.js. The second one just displays console.log("Hello").

Now I would like to pack it somehow into single exe file (I work on Windows) to be able to run it on another machine without the need of having node installed. Is that even possible?


回答1:


The core problem was already answered from here I will provide some specifics on Windows in addition to answer.

basically;

  1. Download and Install JXcore
  2. Go to your apps folder
  3. Run 'jx package index.js myapp -native'

Be careful with the executable you have. If you are on 64 bit Windows, you will end up having a 64 bit executable of your application. Perhaps almost all the Windows installations nowadays are 64 bits and this won't be a big deal. However you can also have a 32 bit version by re-packaging the app on 32 bit Windows. AFAIK the upcoming update to JXcore will be handling this confusion.




回答2:


I wrote a blog post on this here:

http://www.alexjamesbrown.com/blog/development/create-a-standalone-exe-to-run-a-node-js-application/



来源:https://stackoverflow.com/questions/29604839/can-i-make-node-js-app-self-executable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!