fix: Windows scripts check Node.js version, use winget OpenJS.NodeJS.V24
BAT and PS1 now detect if installed Node is < v24 and suggest/install the correct v24 package instead of LTS (v22). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -42,11 +42,22 @@ if (-not $hasPython) {
|
||||
}
|
||||
}
|
||||
|
||||
# Node.js
|
||||
if (-not (Test-Command "node")) {
|
||||
# Node.js v24+
|
||||
$nodeOk = $false
|
||||
if (Test-Command "node") {
|
||||
$nodeVer = (node --version) -replace '^v', ''
|
||||
$nodeMajor = [int]($nodeVer -split '\.')[0]
|
||||
if ($nodeMajor -ge 24) {
|
||||
$nodeOk = $true
|
||||
} else {
|
||||
Write-Host " Node.js v$nodeVer found, need v24+. Upgrading..." -ForegroundColor Yellow
|
||||
}
|
||||
} else {
|
||||
Write-Host " Node.js not found." -ForegroundColor Yellow
|
||||
if (-not (Install-WithWinget "OpenJS.NodeJS" "Node.js")) {
|
||||
Write-Host " Install manually: https://nodejs.org/" -ForegroundColor Yellow
|
||||
}
|
||||
if (-not $nodeOk) {
|
||||
if (-not (Install-WithWinget "OpenJS.NodeJS.V24" "Node.js v24")) {
|
||||
Write-Host " Install Node.js v24+ manually: https://nodejs.org/" -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user