Fix Windows Node version detection in runner setup
This commit is contained in:
1 parent
78bd14318d
commit
d3057a2fc5
1 file changed
+2
-2
@@ -35,7 +35,7 @@ Add-RunnerPath (Split-Path $pwsh)
|
|||||||
Write-Host "PowerShell $(& $pwsh -NoProfile -Command '$PSVersionTable.PSVersion.ToString()') is ready."
|
Write-Host "PowerShell $(& $pwsh -NoProfile -Command '$PSVersionTable.PSVersion.ToString()') is ready."
|
||||||
|
|
||||||
$node = Get-Command node.exe -ErrorAction SilentlyContinue
|
$node = Get-Command node.exe -ErrorAction SilentlyContinue
|
||||||
$nodeMajor = if ($node) { [int](& node -p 'process.versions.node.split(".")[0]') } else { 0 }
|
$nodeMajor = if ($node) { [int]((& node --version).TrimStart('v').Split('.')[0]) } else { 0 }
|
||||||
if ($nodeMajor -lt 22) {
|
if ($nodeMajor -lt 22) {
|
||||||
$nodeVersion = '22.23.3'
|
$nodeVersion = '22.23.3'
|
||||||
$nodeArchive = Join-Path $env:RUNNER_TEMP "node-v$nodeVersion-win-x64.zip"
|
$nodeArchive = Join-Path $env:RUNNER_TEMP "node-v$nodeVersion-win-x64.zip"
|
||||||
@@ -81,5 +81,5 @@ Write-Host "Microsoft C++ Build Tools are ready at $vsPath."
|
|||||||
foreach ($tool in @('cargo.exe', 'rustc.exe', 'node.exe', 'npm.cmd')) {
|
foreach ($tool in @('cargo.exe', 'rustc.exe', 'node.exe', 'npm.cmd')) {
|
||||||
if (-not (Get-Command $tool -ErrorAction SilentlyContinue)) { throw "Missing $tool after dependency setup." }
|
if (-not (Get-Command $tool -ErrorAction SilentlyContinue)) { throw "Missing $tool after dependency setup." }
|
||||||
}
|
}
|
||||||
if ([int](& node -p 'process.versions.node.split(".")[0]') -lt 22) { throw 'Node 22+ is required.' }
|
if ([int]((& node --version).TrimStart('v').Split('.')[0]) -lt 22) { throw 'Node 22+ is required.' }
|
||||||
Write-Host "Windows $Mode dependencies are ready."
|
Write-Host "Windows $Mode dependencies are ready."
|
||||||
Reference in new issue
Block a user