Skip to content

Commit 0b4e032

Browse files
rkeithhillTylerLeonhardt
authored andcommitted
Fix node version detect logic to handle node v10 (#2025)
1 parent f108ba7 commit 0b4e032

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

build.ps1

+8-3
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,17 @@ function needsVSCode () {
4545

4646
function needsNodeJS () {
4747
try {
48-
$nodeJSVersion = (node -v)
49-
48+
$nodeJSVersion = node -v
5049
} catch {
5150
return $true
5251
}
53-
return ($nodeJSVersion.Substring(1,1) -lt 6)
52+
53+
if ($nodeJSVersion -notmatch 'v(\d+\.\d+\.\d+)') {
54+
return $true
55+
}
56+
57+
$nodeVer = [System.Version]$matches[1]
58+
return ($nodeVer.Major -lt 6)
5459
}
5560

5661
function needsPowerShellGet () {

0 commit comments

Comments
 (0)