From 0fa82a54fe38ec14e8054339285d3db71a8624c8 Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Wed, 17 Jul 2024 19:09:34 +0200 Subject: [PATCH] fix: Parse Server installation fails due to post install script incorrectly parsing required min. Node version (#9216) --- package-lock.json | 2 +- package.json | 2 +- postinstall.js | 88 ++++++++++++++++++++--------------------------- 3 files changed, 40 insertions(+), 52 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2cd07c5edc..ae8d4d22a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -103,7 +103,7 @@ "yaml": "1.10.0" }, "engines": { - "node": "18 || 19 || 20 || 22" + "node": ">=18.0.0 <19.0.0 || >=19.0.0 <20.0.0 || >=20.0.0 <21.0.0 || >=22.0.0 <23.0.0" }, "funding": { "type": "opencollective", diff --git a/package.json b/package.json index f7dbf5c0a8..994adae466 100644 --- a/package.json +++ b/package.json @@ -139,7 +139,7 @@ "madge:circular": "node_modules/.bin/madge ./src --circular" }, "engines": { - "node": "18 || 19 || 20 || 22" + "node": ">=18.0.0 <19.0.0 || >=19.0.0 <20.0.0 || >=20.0.0 <21.0.0 || >=22.0.0 <23.0.0" }, "bin": { "parse-server": "bin/parse-server" diff --git a/postinstall.js b/postinstall.js index fe1fc96bae..409ad04e05 100644 --- a/postinstall.js +++ b/postinstall.js @@ -1,50 +1,38 @@ -const pkg = require('./package.json'); - -const version = parseFloat(process.version.substring(1)); -const minimum = parseFloat(pkg.engines.node.match(/\d+/g).join('.')); - -module.exports = function () { - const openCollective = ` - 1111111111 - 1111111111111111 - 1111111111111111111111 - 11111111111111111111111111 - 111111111111111 11111111 - 1111111111111 111111 - 1111111111111 111111111 111111 - 111111111111 11111111111 111111 - 1111111111111 11111111111 111111 - 1111111111111 1111111111 111111 - 1111111111111111111111111 1111111 - 11111111 11111111 - 111111 1111111111111111111 - 11111 11111 111111111111111111 - 11111 11111111111111111 - 111111 111111111111111111 - 11111111111111111111111111 - 1111111111111111111111 - 111111111111111111 - 11111111111 - - - Thanks for installing parse 🙏 - Please consider donating to our open collective - to help us maintain this package. - - 👉 https://opencollective.com/parse-server - - `; - process.stdout.write(openCollective); - if (version >= minimum) { - process.exit(0); - } - - const errorMessage = ` - ⚠️ parse-server requires at least node@${minimum}! - You have node@${version} - - `; - - process.stdout.write(errorMessage); - process.exit(1); -}; +const message = ` + 1111111111 + 1111111111111111 + 1111111111111111111111 + 11111111111111111111111111 + 111111111111111 11111111 + 1111111111111 111 111111 + 1111111111111 111111111 111111 + 111111111111 11111111111 111111 + 1111111111111 11111111111 111111 + 1111111111111 1111111111 111111 + 1111111111111111111111111 1111111 + 11111111 11111111 + 111111 111 1111111111111111111 + 11111 11111 111111111111111111 + 11111 1 11111111111111111 + 111111 111111111111111111 + 11111111111111111111111111 + 1111111111111111111111 + 111111111111111111 + 11111111111 + + Thank you for using Parse Platform! + https://parseplatform.org + +Please consider donating to help us maintain + this package: + +👉 https://opencollective.com/parse-server 👈 + +`; + +function main() { + process.stdout.write(message); + process.exit(0); +} + +module.exports = main;