Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

* Update preinstall script * Update readme

Ben59fd346e2dbd
diff --git a/README.md b/README.md
index f2ce7f8f7..89b15d8df 100644
--- a/README.md
+++ b/README.md
@@ -45,7 +45,7 @@ View the [Configuration](doc/configuration.md) section for information on how to
The following are required to install and run Worldview:
-- [Node v12.21.0 or Later](https://nodejs.org/en/download/)
+- [Node v16.14.0](https://nodejs.org/en/download/)
- **Note:** Ubuntu users may run into issues with the `node` command not being available. See [this question on StackOverflow](https://stackoverflow.com/q/18130164/417629) for possible solutions.
- [Python v3.7.1 or Later](https://www.python.org/)
diff --git a/package-lock.json b/package-lock.json
index e4b198a90..eb380a39e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -148,7 +148,7 @@
"yargs": "^15.3.0"
},
"engines": {
- "node": ">=16.0.0 <=16.14.0"
+ "node": "16.14.0"
}
},
"node_modules/@ampproject/remapping": {
diff --git a/package.json b/package.json
index a6c64a472..4ef3353ff 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,7 @@
"license": "NASA-1.3",
"repository": "nasa-gibs/worldview",
"engines": {
- "node": ">=16.0.0 <=16.14.0"
+ "node": "16.14.0"
},
"husky": {
"hooks": {
diff --git a/tasks/checkNodeVersion.js b/tasks/checkNodeVersion.js
index c89026655..61a5ae464 100755
--- a/tasks/checkNodeVersion.js
+++ b/tasks/checkNodeVersion.js
@@ -25,19 +25,19 @@ const versionCompare = (v1, v2) => {
return true;
};
-
-const [minVersion] = pkg.engines.node.split(' ');
+const packageNode = pkg.engines.node;
+const packageNodeArray = pkg.engines.node.split(' ');
+const [minVersion] = packageNodeArray;
const nodeVersion = process.version;
const requiredVersionSub = minVersion.substr(2, minVersion.length);
const nodeVersionSub = nodeVersion.substr(1, nodeVersion.length);
-const satisfiyMinVersion = versionCompare(nodeVersionSub, requiredVersionSub);
+const satisfyMinVersion = packageNodeArray.length > 1 ? versionCompare(nodeVersionSub, requiredVersionSub) : pkg.engines.node === nodeVersionSub;
-if (!satisfiyMinVersion) {
- const requiredVersionText = pkg.engines.node;
+if (!satisfyMinVersion) {
console.log('\x1b[31m', '\x1b[1m'); // Added styling to warn
- console.log('WARN', '\x1b[0m', 'The suggested version of node for the installation of Worldview is', '\x1b[32m', '\x1b[1m', requiredVersionText, '\x1b[0m', ' you are using', '\x1b[32m', '\x1b[1m', nodeVersion);
- console.log('\x1b[0m', 'If you have difficulties installing Worldview, please try using the install again using a compatible node version', '\x1b[32m', '\x1b[1m', requiredVersionText, '\x1b[0m');
+ console.log('WARN', '\x1b[0m', 'The suggested version(s) of node for the installation of Worldview is', '\x1b[32m', '\x1b[1m', packageNode, '\x1b[0m', ' you are using', '\x1b[32m', '\x1b[1m', nodeVersion);
+ console.log('\x1b[0m', 'If you have difficulties installing Worldview, please try using the install again using the compatible node version(s)', '\x1b[32m', '\x1b[1m', packageNode, '\x1b[0m');
} else {
console.log('\x1b[0mPreinstall conditions satisfied. Installing...', '\x1b[0m');
}