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

Postinstall script incorrectly parses required min. Node version #9214

Closed
mtrezza opened this issue Jul 17, 2024 · 6 comments · Fixed by #9216
Closed

Postinstall script incorrectly parses required min. Node version #9214

mtrezza opened this issue Jul 17, 2024 · 6 comments · Fixed by #9216
Labels
state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@mtrezza
Copy link
Member

mtrezza commented Jul 17, 2024

New Issue Checklist

Issue Description

The post install script makes the installation fail if the min. Node version in package.json is higher than the environment Node version. However, it regex-parses the engine.node value instead of properly semver-parsing it to properly handle any possible semver notation.

const minimum = parseFloat(pkg.engines.node.match(/\d+/g).join('.'));

The current string is parsed incorrect so that the required min. Node version is 18.19:

parse-server/package.json

Lines 141 to 143 in 9282e34

"engines": {
"node": "18 || 19 || 20 || 22"
},

This also points to a larger issue with the Parse Server engine.node value, because only specifying the major version means that Parse Server is compatible with Node 18.0.0, which may not even be the case as it has never been tested with that exact version.

Environment

Server

  • Parse Server version: 7.2.0
Copy link

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Jul 17, 2024
@dplewis
Copy link
Member

dplewis commented Jul 17, 2024

I'd recommend removing the check altogether. npm will let developer's know which versions are supported.

@mtrezza
Copy link
Member Author

mtrezza commented Jul 17, 2024

I've changed this to use semver, but I think you are right, better to remove it

@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.3.0-alpha.3

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Jul 17, 2024
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.3.0-beta.1

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Oct 3, 2024
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.3.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
3 participants