@squiz/dxp-cli-next 2.9.0 → 2.10.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/dxp.js +10 -0
- package/package.json +1 -1
package/lib/dxp.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const commander_1 = __importDefault(require("commander"));
|
|
7
7
|
const update_notifier_1 = __importDefault(require("update-notifier"));
|
|
8
8
|
const pkg = require('../package.json');
|
|
9
|
+
validateNodeVersion();
|
|
9
10
|
(0, update_notifier_1.default)({ pkg, updateCheckInterval: 1 }).notify({
|
|
10
11
|
isGlobal: true,
|
|
11
12
|
});
|
|
@@ -26,3 +27,12 @@ program
|
|
|
26
27
|
program.help();
|
|
27
28
|
})
|
|
28
29
|
.parse(process.argv);
|
|
30
|
+
function validateNodeVersion() {
|
|
31
|
+
const nodeVersionParts = process.versions.node
|
|
32
|
+
.split('.')
|
|
33
|
+
.map(part => Number(part));
|
|
34
|
+
const [nodeVersion] = nodeVersionParts;
|
|
35
|
+
if (nodeVersion < 16) {
|
|
36
|
+
throw new Error(`You are running an older version of node(${process.version}). Please install node v16 or higher`);
|
|
37
|
+
}
|
|
38
|
+
}
|