@automattic/vip 3.20.2 → 3.20.4
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/dist/bin/vip.js +1 -0
- package/dist/lib/node-version-check.js +20 -0
- package/npm-shrinkwrap.json +311 -311
- package/package.json +3 -3
package/dist/bin/vip.js
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _nodeFs = require("node:fs");
|
|
4
|
+
var _nodePath = require("node:path");
|
|
5
|
+
var _semver = require("semver");
|
|
6
|
+
const boldRed = process.stdout.isTTY ? '\x1b[1;31m' : '';
|
|
7
|
+
const reset = process.stdout.isTTY ? '\x1b[0m' : '';
|
|
8
|
+
try {
|
|
9
|
+
const json = (0, _nodeFs.readFileSync)((0, _nodePath.join)(__dirname, '..', '..', 'package.json'), 'utf8');
|
|
10
|
+
const {
|
|
11
|
+
name,
|
|
12
|
+
engines
|
|
13
|
+
} = JSON.parse(json);
|
|
14
|
+
const version = engines.node;
|
|
15
|
+
if (version && !(0, _semver.satisfies)(process.version, version)) {
|
|
16
|
+
console.warn(`${boldRed}WARNING: The current version of Node (${process.version}) does not meet the minimum requirements; ` + `${name} requires Node version ${version}.\n\n` + `Please follow the installation instructions at https://nodejs.org/en/download/ to upgrade.${reset}\n`);
|
|
17
|
+
}
|
|
18
|
+
} catch {
|
|
19
|
+
// Do nothing
|
|
20
|
+
}
|