-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Parse Server installation fails due to post install script incor…
…rectly parsing required min. Node version (#9216)
- Loading branch information
Showing
3 changed files
with
40 additions
and
52 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |