Check Node.js version, better error message

pull/1194/head
Louis 3 years ago
parent 2c7a701c84
commit d1a99b0a22

@ -1,4 +1,15 @@
console.log("Welcome to Uptime Kuma");
// Check Node.js Version
const nodeVersion = parseInt(process.versions.node.split(".")[0]);
const requiredVersion = 14;
console.log(`Your Node.js version: ${nodeVersion}`);
if (nodeVersion < requiredVersion) {
console.error(`Error: Your Node.js version is not supported, please upgrade to Node.js >= ${requiredVersion}.`);
process.exit(-1);
}
const args = require("args-parser")(process.argv);
const { sleep, debug, getRandomInt, genSecret } = require("../src/util");
const config = require("./config");

Loading…
Cancel
Save