From 6e0e772d885b8b0d0b9b98c9aa20b420ce0e940f Mon Sep 17 00:00:00 2001 From: Dragory Date: Thu, 3 Jan 2019 03:47:52 +0200 Subject: [PATCH] Fix Node.js version check --- src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index f3f77608..4ddac01f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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