From 303df3fe6e77babcf2f1b8aca5570c3327f6b11b Mon Sep 17 00:00:00 2001 From: Oleksandr Taruraiev Date: Mon, 29 Jun 2026 20:05:55 +0300 Subject: [PATCH] fix(ci): probe common Node.js install paths on Windows when PATH lookup fails GUI apps like Connect wizard may not inherit the user's shell PATH, causing Node.js detection to fail even when Node is installed at C:\Program Files\nodejs\. Add fallback probes for the most common install locations before throwing 'Node.js not found'. Probed paths: - %ProgramFiles%\nodejs\node.exe - %ProgramFiles(x86)%\nodejs\node.exe - %LOCALAPPDATA%\Programs\nodejs\node.exe Fixes: INC0000773156 Generated with AI Co-Authored-By: codemie-ai --- install/windows/install.ps1 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/install/windows/install.ps1 b/install/windows/install.ps1 index df27152d..88a7ab94 100644 --- a/install/windows/install.ps1 +++ b/install/windows/install.ps1 @@ -126,6 +126,26 @@ $PrefixDir = Join-Path $InstallRoot 'npm-prefix' $NpmPath = Get-CommandPath 'npm.cmd' $NodePath = Get-CommandPath 'node.exe' $GitPath = Get-CommandPath 'git.exe' + +# Fallback: probe common Node.js install locations when PATH lookup fails. +# GUI apps (e.g. Connect wizard) may not inherit the user's shell PATH. +if (-not $NodePath) { + $probes = @( + "$env:ProgramFiles\nodejs\node.exe", + "${env:ProgramFiles(x86)}\nodejs\node.exe", + "$env:LOCALAPPDATA\Programs\nodejs\node.exe" + ) + foreach ($probe in $probes) { + if (Test-Path $probe) { + $NodePath = $probe + if (-not $NpmPath) { + $NpmPath = Join-Path (Split-Path $probe) 'npm.cmd' + } + break + } + } +} + $NodeMajor = Get-NodeMajor $NodePath Write-Host 'CodeMie installer diagnostics'