Creating executables with Node 25+
NicolasBrondinBernard
Discover the new Node.js feature that allows you to create executables directly, without using external modules like pkg or nexe.

Article published on 10/07/2026, last updated on 10/08/2026
For a long time, creating an executable from a Node.js application required an external tool. The best known were pkg or nexe, capable of turning a JavaScript application into an .exe file on Windows, or into an executable binary on Linux and macOS.
The goal was simple: distribute an application without asking the user to install Node.js.
Since version 18.16 (LTS), Node.js has offered Single Executable Applications (SEA), a mechanism allowing an application to be embedded directly into a Node executable.
This feature has recently taken a new step forward (since 25.5) with the arrival of the --build-sea command, which makes it possible to generate an executable directly from the command line, without relying on external tools.
In other words: Node.js can now produce an executable itself.
How to do it
You simply need to provide a JSON configuration file (here sea-config.json) describing your application.
For example:
{
"main": "./dist/index.js",
"output": "./mon-application"
}
Then run:
node --build-sea sea-config.json
Node.js then generates an executable containing both the runtime and your application.
Why is this good news?
The main advantage is simplicity. Until now, you often had to install an additional tool, check its compatibility with your version of Node.js, and hope it would continue to be maintained.
With an official solution, all of that disappears.
You get a feature developed directly by the Node.js team, which will evolve alongside the runtime.
A feature that is still young
However, one thing needs to be kept in mind: even though this feature is becoming increasingly mature, it is still marked as under active development in the official Node.js documentation.
Some limitations still exist.
For example, the early versions of SEA only supported CommonJS applications. Recent versions now also support ECMAScript modules (ESM), but not all features of a Node project are necessarily compatible depending on your configuration.
If your application depends on tools like Puppeteer, native modules, or external resources, some adjustments may still be necessary.
Should you abandon pkg?
For a new project, the answer is probably yes.
Node.js's native feature is intended to gradually replace historical packaging tools. It is better integrated with the runtime and no longer depends on a third-party project that could stop being maintained.
On the other hand, if you already have a build chain based on
pkgthat works perfectly, there's not necessarily any urgency to change it.
Note
Node does not "compile" your JavaScript code into machine code. It embeds your application into an existing Node executable, which is itself specific to an operating system and architecture (Windows, Linux, macOS, x64, ARM64, etc.).
Complete courses, exercises and certificates to really learn programming!
4.8 average rating
No comments yet