Skip to content

Commit d437511

Browse files
kriszypclaude
andauthored
chore: update engines.node to ^22.18.0 || >=24.0.0 for rocksdb-js 2.0.0 (#1221)
* chore: update engines.node to ^22.18.0 || >=24.0.0 for rocksdb-js 2.0.0 * fix: use semver.satisfies for Node version check, drop minimum-node field The major-only comparison would pass Node 22.0–22.17 despite them violating the ^22.18.0 requirement. Now reads engines.node directly so the check stays in sync with package.json automatically. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e6dc8a6 commit d437511

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const semverMajor = require('semver/functions/major');
3+
const semver = require('semver');
44
const { packageJson } = require('../../utility/packageUtils.js');
55
const INSTALLED_NODE_VERSION = process.versions && process.versions.node ? process.versions.node : undefined;
66

@@ -9,9 +9,9 @@ module.exports = checkNodeVersion;
99
function checkNodeVersion() {
1010
// Skip Node version check when running on Bun
1111
if (typeof globalThis.Bun !== 'undefined') return;
12-
const minimumHdbNodeVersion = packageJson.engines['minimum-node'];
13-
if (INSTALLED_NODE_VERSION && semverMajor(INSTALLED_NODE_VERSION) < semverMajor(minimumHdbNodeVersion)) {
14-
const versionError = `The minimum version of Node.js Harper supports is: ${minimumHdbNodeVersion}, the currently installed Node.js version is: ${INSTALLED_NODE_VERSION}. Please install a version of Node.js that is withing the defined range.`;
12+
const requiredRange = packageJson.engines.node;
13+
if (INSTALLED_NODE_VERSION && !semver.satisfies(INSTALLED_NODE_VERSION, requiredRange)) {
14+
const versionError = `Harper requires Node.js ${requiredRange}, but the currently installed version is ${INSTALLED_NODE_VERSION}. Please install a compatible version.`;
1515
return { error: versionError };
1616
}
1717
}

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@
103103
}
104104
},
105105
"engines": {
106-
"node": ">=20",
107-
"minimum-node": "20.0.0"
106+
"node": "^22.18.0 || >=24.0.0"
108107
},
109108
"devEngines": {
110109
"runtime": {

0 commit comments

Comments
 (0)