feat(deps): remove dependency on semver

This commit is contained in:
Elian Doran
2025-02-04 21:15:47 +02:00
parent d908c9044b
commit ce45309818
4 changed files with 48 additions and 15 deletions

View File

@@ -12,7 +12,8 @@ import ws from "./services/ws.js";
import utils from "./services/utils.js";
import port from "./services/port.js";
import host from "./services/host.js";
import semver from "semver";
const MINIMUM_NODE_VERSION = "22.0.0";
// setup basic error handling even before requiring dependencies, since those can produce errors as well
@@ -32,8 +33,8 @@ function exit() {
process.on("SIGINT", exit);
process.on("SIGTERM", exit);
if (!semver.satisfies(process.version, ">=10.5.0")) {
console.error("Trilium only supports node.js 10.5 and later");
if (utils.compareVersions(process.version, MINIMUM_NODE_VERSION) < 0) {
console.error(`\nTrilium requires Node.js ${MINIMUM_NODE_VERSION} and later.\n`);
process.exit(1);
}