Skip to content

Commit

Permalink
fix: Require Node.js 20 for SEA (#8)
Browse files Browse the repository at this point in the history
I made a mistake: While "single executable applications" are supported
in Node.js 18, their API is quite different from the one in Node.js 20.
To make things easier here, we're just excluding Node 18 & 19.

Also improved: Node.js error logging.
  • Loading branch information
felixrieseberg authored Feb 7, 2024
1 parent 8b23eaa commit 2374696
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/sea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,12 @@ async function createBlob(options: InternalSeaOptions) {

log(`Calling ${bin} with options:`, args);

return spawnPromise(bin, args, {
const { stderr, stdout } = await spawnPromise(bin, args, {
cwd
});

log('stdout:', stdout);
log('stderr:', stderr);
}

async function createBinary(options: InternalSeaOptions) {
Expand Down Expand Up @@ -233,20 +236,11 @@ function checkCompatibility() {
const version = process.versions.node;
const split = version.split('.');
const major = parseInt(split[0], 10);
const minor = parseInt(split[1], 10);

if (major >= 20) {
return true;
}

if (major === 19 && minor >= 7) {
return true;
}

if (major === 18 && minor >= 16) {
return true;
}

throw new Error(`Your Node.js version (${process.version}) does not support Single Executable Applications. Please upgrade your version of Node.js.`);
}

Expand Down

0 comments on commit 2374696

Please sign in to comment.