Skip to content

Commit ebf1974

Browse files
committed
Check Node.js version
1 parent f366595 commit ebf1974

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/tstl.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,17 @@ function updateWatchCompilationHost(
204204
};
205205
}
206206

207+
function checkNodeVersion() {
208+
const [major, minor] = process.version.split(".").map(Number);
209+
const isValid = major > 12 || (major === 12 && minor >= 13);
210+
if (!isValid) {
211+
console.error(`TypeScriptToLua requires Node.js >=12.13.0, the current version is v${process.version}`);
212+
process.exit(1);
213+
}
214+
}
215+
216+
checkNodeVersion();
217+
207218
if (ts.sys.setBlocking) {
208219
ts.sys.setBlocking();
209220
}

0 commit comments

Comments
 (0)