How to make exe files from a node.js app?
There a few alternatives, both free and commercial. I haven't used any of them but in theory they should work:
- Iexpress (native windows tool)
- Quick Batch File Compiler (commercial)
- BoxedApp Packer
- "Advanced" Batch To EXE Converter" (freeware)
Most will require you to keep the batch file as main executable, and then bundle node.exe and your scripts.
Depending on your script, you also have the option to port it to JSDB, which supports an easy way to create executables by simply appending resources to it.
A third quasi-solution is to keep node somewhere like C:\utils
and add this folder to your PATH
environment variable. Then you can create .bat files in that dir that run node + your preferred scripts - I got coffeescript's coffee
working on windows this way. This setup can be automated with a batch file, vb script or installer.
How to convert a Node.js app to exe?
nexe says it will create a single executable out of your node.js apps.
https://github.com/nexe/nexe
How to make a executable from a NodeJS+Express app?
The guide Standalone Express API Binaries with pkg explains how to make standalone express executables.
NodeJS project to EXE file
I made an idiotic mistake... I forgot to type needed command after "command-win.exe". Now everything works fine.
How to make a node js an exe file
You can change the icons of executables generated with pkg
with ResourceHacker. There is even a discussion about it on the GitHub repository of pkg
.
In this discussion, a person even wrote a script to automate icon adding while building with pkg
.
How to make exe file from Reactjs and a nodejs app?
Electron has already been mentioned by @SLaks.
Another way to package a JavaScript app as an executable is using NW.js. Docs here.
Simply, compress your .js
sources (you'll need to write some NW boilerplate, see the docs) into a .zip
, and concatenate that with nw.exe
:
copy /b nw.exe+your.zip your.exe
Then you get your.exe
, an executable version of your app.
Creating an Executable File for my Node.JS App
try:
const path = require('path');
AWS.config.loadFromPath(path.join(__dirname, 'config.json'));
then, if that is not enough, try changing all references of 'myverse.mp3' to:
path.join(__dirname, 'myverse.mp3')
Documentation about __dirname
Related Topics
How Does the New Operator Work in JavaScript
Cancel a Vanilla Ecmascript 6 Promise Chain
What Does [].Foreach.Call() Do in JavaScript
Access Outside Variable in Loop from JavaScript Closure
How to Figure Out the Highest Z-Index in Your Document
Adding Multiple Event Listeners to One Element
Getting Unparsed (Raw) HTML with JavaScript
Detecting That the Browser Has No Mouse and Is Touch-Only
Multicolor Text Highlighting in a Textarea or Text Input
Msie and Addeventlistener Problem in JavaScript
Recursively Looping Through an Object to Build a Property List
How to Query Mongodb Objectid by Date
Is There Ever a Good Reason to Pass a String to Settimeout
How to Open a New Window and Insert HTML into It Using Jquery
How to Change CSS :Root Color Variables in JavaScript