Skip to content

Postinstall script incorrectly parses required min. Node version #9214

Closed
@mtrezza

Description

@mtrezza

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:releasedReleased as stable versionstate:released-alphaReleased as alpha versionstate:released-betaReleased as beta versiontype:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions