From 2df86b73f3eea588b6d459a6dc303a2aecc019ec Mon Sep 17 00:00:00 2001 From: Joe Uhren Date: Sun, 17 Sep 2023 17:40:22 -0600 Subject: [PATCH] Update mongodb dependency to 6.x -Although the explorer still seems to work fine with older node.js versions, the mongodb 6.x docs indicate that the minimum supported version is v16.20.1 and therefore the explorer has been updated to also enforce this as the min version to help prevent future problems -A small fix was applied to the prestart script that was previously not stopping execution of the explorer when an older version of node.js was found. This was bug only affected running the explorer with `npm start` --- package.json | 2 +- scripts/prestart.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index c30b73c..932bdc5 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "express": ">=4.18.1", "intl": "^1.2.5", "jsonminify": "^0.4.2", - "mongodb": "^5.4.0", + "mongodb": "^6.1.0", "mongoose": "^7.1.0", "morgan": ">=1.10.0", "postman-request": "^2.88.1-postman.31", diff --git a/scripts/prestart.js b/scripts/prestart.js index 1a80db2..72dc71c 100644 --- a/scripts/prestart.js +++ b/scripts/prestart.js @@ -1,5 +1,5 @@ -const minNodeVersionMajor = '14'; -const minNodeVersionMinor = '13'; +const minNodeVersionMajor = '16'; +const minNodeVersionMinor = '20'; const minNodeVersionRevision = '1'; // get the nodejs version @@ -29,7 +29,7 @@ if (nodeVersion != null && nodeVersion != '' && nodeVersion.length < 16) { // check if the installed nodejs is an older version than supported by the explorer if (!(nodeVersionMajor > minNodeVersionMajor || (nodeVersionMajor == minNodeVersionMajor && (nodeVersionMinor > minNodeVersionMinor || (nodeVersionMinor == minNodeVersionMinor && nodeVersionRevision >= minNodeVersionRevision))))) { console.log(`Please install an updated version of nodejs.\n\nInstalled: ${nodeVersion}\nRequired: ${minNodeVersionMajor}.${minNodeVersionMinor}.${minNodeVersionRevision}`); - process.exit(0); + process.exit(1); } function check_arguments_passed(cb) {