Back to results for “Deployment & Process Managers (PM2)”
Node.js › Advanced Node.js

What are Node.js Single Executable Applications (SEA), and what are their current limitations?

Advanced

Answer

Single Executable Applications, stable since Node 20+, let you package a Node.js application and its dependencies into a single standalone binary that runs without requiring a separate Node.js installation on the target machine -- built by injecting a compiled JavaScript blob into a copy of the Node binary itself. Current limitations include no built-in support for native addons in every configuration, larger resulting binary sizes than lightweight alternatives, and less mature tooling for cross-compiling for other platforms compared to tools purpose-built for this (like pkg or nexe historically).
# Generate a config and blob
node --experimental-sea-config sea-config.json

# Inject the blob into a copy of the node binary
node -e "require('fs').copyFileSync(process.execPath, 'myapp')"
postject myapp NODE_SEA_BLOB sea-prep.blob \
  --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
Real-world example A CLI tool vendor ships their Node.js-based utility as a single executable using SEA so that end users on machines without Node.js installed can simply download and run one file, avoiding the friction of requiring them to install a Node.js runtime first.

Common follow-ups: How does SEA compare in practice to using Docker as the distribution mechanism instead?;What specific native modules or dependencies are currently known to be incompatible with SEA packaging?