Skip to content

Commit

Permalink
workauround issue opensearch-project#2088
Browse files Browse the repository at this point in the history
  • Loading branch information
sipopo authored Aug 8, 2022
1 parent 2d6eef9 commit 0e69255
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/setup_node_env/node_version_validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ var rawRequiredVersion = (pkg && pkg.engines && pkg.engines.node) || null;
var requiredVersion = rawRequiredVersion ? 'v' + rawRequiredVersion : rawRequiredVersion;
var currentVersionMajorMinorPatch = currentVersion.match(/^v(\d+)\.(\d+)\.(\d+)/);
var requiredVersionMajorMinorPatch = requiredVersion.match(/^v(\d+)\.(\d+)\.(\d+)/);
var currentMinorPatch = currentVersionMajorMinorPatch[2].concat(".", currentVersionMajorMinorPatch[3]);
var requiredMinorPatch = requiredVersionMajorMinorPatch[2].concat(".", requiredVersionMajorMinorPatch[3]);
var isVersionValid =
currentVersionMajorMinorPatch[1] === requiredVersionMajorMinorPatch[1] &&
currentVersionMajorMinorPatch[2] === requiredVersionMajorMinorPatch[2] &&
parseInt(currentVersionMajorMinorPatch[3], 10) >= parseInt(requiredVersionMajorMinorPatch[3], 10);
parseFloat(currentMinorPatch) >= parseFloat(requiredMinorPatch);

// Validates current the NodeJS version compatibility when OpenSearch Dashboards starts.
if (!isVersionValid) {
Expand Down

0 comments on commit 0e69255

Please sign in to comment.