Fix Node.js version check
This commit is contained in:
parent
f7c29eb2cf
commit
6e0e772d88
1 changed files with 3 additions and 3 deletions
|
@ -29,9 +29,9 @@ const REQUIRED_NODE_VERSION = "10.14.2";
|
|||
const requiredParts = REQUIRED_NODE_VERSION.split(".").map(v => parseInt(v, 10));
|
||||
const actualVersionParts = process.versions.node.split(".").map(v => parseInt(v, 10));
|
||||
for (const [i, part] of actualVersionParts.entries()) {
|
||||
if (part < requiredParts[i]) {
|
||||
throw new SimpleError(`Unsupported Node.js version! Must be at least ${REQUIRED_NODE_VERSION}`);
|
||||
}
|
||||
if (part > requiredParts[i]) break;
|
||||
if (part === requiredParts[i]) continue;
|
||||
throw new SimpleError(`Unsupported Node.js version! Must be at least ${REQUIRED_NODE_VERSION}`);
|
||||
}
|
||||
|
||||
// Always use UTC
|
||||
|
|
Loading…
Add table
Reference in a new issue