feat: use LTS Node.js version for installation
- Replace hardcoded setup_24.x with setup_lts.x for Linux apt/dnf/yum - Update Windows installer to use Node.js 22 LTS with dynamic version fetch - Update install messages to reflect LTS instead of specific version - Fixes: Node.js 24+ requirement causing installation failures on some systems - Ensures latest LTS version (20.x, 22.x) is used instead of bleeding edge Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -95,12 +95,19 @@ if ($nodeMajor -ge $MIN_NODE_MAJOR) {
|
||||
if ((Get-NodeMajor) -ge $MIN_NODE_MAJOR) { $installed = $true }
|
||||
}
|
||||
|
||||
# 3. Direct MSI download — Node.js 20 LTS (most compatible)
|
||||
# 3. Direct MSI download — Node.js 22 LTS (most compatible)
|
||||
if (-not $installed) {
|
||||
Write-Host " Downloading Node.js 20 LTS MSI..." -ForegroundColor Yellow
|
||||
Write-Host " Downloading Node.js 22 LTS MSI..." -ForegroundColor Yellow
|
||||
try {
|
||||
$msiUrl = "https://nodejs.org/dist/v20.18.0/node-v20.18.0-x64.msi"
|
||||
$msiFile = Join-Path $env:TEMP "node-v20-lts.msi"
|
||||
# Try to get latest LTS version dynamically, fallback to known good version
|
||||
$latestLts = "v22.14.0"
|
||||
try {
|
||||
$releases = Invoke-RestMethod -Uri "https://nodejs.org/dist/index.json" -UseBasicParsing -TimeoutSec 10
|
||||
$lts = $releases | Where-Object { $_.lts -and $_.version -match "^v22\." } | Select-Object -First 1
|
||||
if ($lts) { $latestLts = $lts.version }
|
||||
} catch {}
|
||||
$msiUrl = "https://nodejs.org/dist/$latestLts/node-$latestLts-x64.msi"
|
||||
$msiFile = Join-Path $env:TEMP "node-lts.msi"
|
||||
Invoke-WebRequest -Uri $msiUrl -OutFile $msiFile -UseBasicParsing
|
||||
Start-Process msiexec.exe -ArgumentList "/i `"$msiFile`" /quiet /norestart" -Wait
|
||||
Refresh-Path
|
||||
|
||||
Reference in New Issue
Block a user