From b7ad7102cc25483656e71d0f95a78377e08f154d Mon Sep 17 00:00:00 2001 From: Keith Hill Date: Fri, 14 Jun 2019 09:44:58 -0600 Subject: [PATCH] Fix node version detect logic to handle node v10 --- build.ps1 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/build.ps1 b/build.ps1 index 3f8a20d416..fdd5479f4b 100644 --- a/build.ps1 +++ b/build.ps1 @@ -45,12 +45,17 @@ function needsVSCode () { function needsNodeJS () { try { - $nodeJSVersion = (node -v) - + $nodeJSVersion = node -v } catch { return $true } - return ($nodeJSVersion.Substring(1,1) -lt 6) + + if ($nodeJSVersion -notmatch 'v(\d+\.\d+\.\d+)') { + return $true + } + + $nodeVer = [System.Version]$matches[1] + return ($nodeVer.Major -lt 6) } function needsPowerShellGet () {