Skip to content

Commit

Permalink
Fix: Minimum version check
Browse files Browse the repository at this point in the history
  • Loading branch information
JacoKoster committed Jul 14, 2023
1 parent 0b690ca commit 2cd889d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions bin/signalk-server
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
* limitations under the License.
*/

const { engines } = require('../package.json');
const semver = require('semver');

const version = engines.node;

if (!semver.satisfies(process.version, version)) {
console.log(`The installed version of node (${process.version}) is older than the required minimum version (${version}). See https://github.com/SignalK/signalk-server/wiki/Updating-to-Node.js-18 for more information how to upgrade.`);
process.exit(1);
}

const Server = require('../lib')
const server = new Server()

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
],
"license": "Apache-2.0",
"engines": {
"node": ">=16"
"node": ">=18"
},
"workspaces": [
"packages/server-admin-ui-dependencies",
Expand Down Expand Up @@ -118,7 +118,7 @@
"ncp": "^2.0.0",
"node-fetch": "^2.6.0",
"primus": "^7.0.0",
"semver": "^7.1.1",
"semver": "^7.5.4",
"split": "^1.0.0",
"stat-mode": "^1.0.0",
"swagger-ui-express": "^4.5.0",
Expand Down

0 comments on commit 2cd889d

Please sign in to comment.