From c1efe0f26d7e28f4c656cd05178a0af8424a5a63 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Fri, 26 May 2023 18:08:52 +0800 Subject: [PATCH] Add a warning for Node.js >= 20 --- server/server.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/server.js b/server/server.js index 12a711e80..ca046a017 100644 --- a/server/server.js +++ b/server/server.js @@ -19,6 +19,11 @@ const nodeVersion = parseInt(process.versions.node.split(".")[0]); const requiredVersion = 14; console.log(`Your Node.js version: ${nodeVersion}`); +// See more: https://github.com/louislam/uptime-kuma/issues/3138 +if (nodeVersion >= 20) { + console.warn("\x1b[31m%s\x1b[0m", "Warning: Uptime Kuma is currently not stable on Node.js >= 20, please use Node.js 18."); +} + if (nodeVersion < requiredVersion) { console.error(`Error: Your Node.js version is not supported, please upgrade to Node.js >= ${requiredVersion}.`); process.exit(-1);