Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Parse Server installation fails due to post install script incorrectly parsing required min. Node version #9216

Merged
merged 8 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
88 changes: 38 additions & 50 deletions postinstall.js
Original file line number Diff line number Diff line change
@@ -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;
Loading