From 1f181536ae4c014cb203e9a9d79f2658113d29d6 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 8 Jul 2023 08:52:51 +0900 Subject: [PATCH] use engines --- .node-version-min | 1 - packages/backend/package.json | 3 +++ packages/backend/src/boot/master.ts | 6 ------ 3 files changed, 3 insertions(+), 7 deletions(-) delete mode 100644 .node-version-min diff --git a/.node-version-min b/.node-version-min deleted file mode 100644 index 6d80269a4..000000000 --- a/.node-version-min +++ /dev/null @@ -1 +0,0 @@ -18.16.0 diff --git a/packages/backend/package.json b/packages/backend/package.json index 87f7f9ddf..5da710175 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -3,6 +3,9 @@ "main": "./index.js", "private": true, "type": "module", + "engines": { + "node": ">=18.16.0" + }, "scripts": { "start": "node ./built/index.js", "start:test": "NODE_ENV=test node ./built/index.js", diff --git a/packages/backend/src/boot/master.ts b/packages/backend/src/boot/master.ts index 3e149864e..2a2375725 100644 --- a/packages/backend/src/boot/master.ts +++ b/packages/backend/src/boot/master.ts @@ -96,12 +96,6 @@ function showNodejsVersion(): void { const nodejsLogger = bootLogger.createSubLogger('nodejs'); nodejsLogger.info(`Version ${process.version} detected.`); - - const minVersion = fs.readFileSync(`${_dirname}/../../../../.node-version-min`, 'utf-8').trim(); - if (semver.lt(process.version, minVersion)) { - nodejsLogger.error(`At least Node.js ${minVersion} required!`); - process.exit(1); - } } function loadConfigBoot(): Config {