Fix Windows Node version detection in runner setup
CI / Real Minecraft installs (manual) (push) Skipped
CI / Rust, web and container (push) Canceled after 0s
CI / Windows launcher (push) Canceled after 4m9s

This commit is contained in:
SCOPEDD committed 2026-10-01 01:11:04 -04:00
1 parent 78bd14318d
commit d3057a2fc5
1 file changed
+2 -2
+2 -2
View File
@@ -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."