Skip to content

Commit 2349199

Browse files
[Windows] Rework NodeJS install (#4375)
1 parent 64b553b commit 2349199

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

images/win/scripts/Installers/Install-NodeLts.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ $CachePath = 'C:\npm\cache'
1010
New-Item -Path $PrefixPath -Force -ItemType Directory
1111
New-Item -Path $CachePath -Force -ItemType Directory
1212

13-
Choco-Install -PackageName nodejs-lts -ArgumentList "--force"
13+
$defaultVersion = (Get-ToolsetContent).node.default
14+
Choco-Install -PackageName nodejs -ArgumentList "--version=$defaultVersion"
1415

1516
Add-MachinePathItem $PrefixPath
1617
$env:Path = Get-MachinePath

images/win/scripts/Tests/Node.Tests.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@ Describe "Node.JS" {
1616
$Test | Should -ReturnZeroExitCode
1717
}
1818
}
19+
20+
Context "Node.js version" {
21+
It "Node.js version should correspond to the version in the toolset" {
22+
node --version | Should -BeLike "v$((Get-ToolsetContent).node.default)*"
23+
}
24+
}
1925
}

images/win/toolsets/toolset-2016.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,5 +421,8 @@
421421
"args": [ "--installargs", "ADD_CMAKE_TO_PATH=\"System\"" ]
422422
}
423423
]
424+
},
425+
"node": {
426+
"default": "14.18.1"
424427
}
425428
}

images/win/toolsets/toolset-2019.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,5 +452,8 @@
452452
"args": [ "--installargs", "ADD_CMAKE_TO_PATH=\"System\"" ]
453453
}
454454
]
455+
},
456+
"node": {
457+
"default": "14.18.1"
455458
}
456459
}

images/win/toolsets/toolset-2022.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,5 +289,8 @@
289289
"args": [ "--installargs", "ADD_CMAKE_TO_PATH=\"System\"" ]
290290
}
291291
]
292+
},
293+
"node": {
294+
"default": "14.18.1"
292295
}
293296
}

0 commit comments

Comments
 (0)