fix: address additional code review feedback

- Add path.normalize() for Windows mixed separator handling
- Add validation to check Node executable exists after finding it
- Improve error dialog with specific troubleshooting advice for Node.js
  related errors vs general errors
- Include source info in validation error message

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Kacper
2025-12-21 14:54:26 +01:00
parent d3005393df
commit 887fb93b3b
2 changed files with 17 additions and 3 deletions

View File

@@ -334,8 +334,10 @@ export function buildEnhancedPath(nodePath: string, currentPath: string = ''): s
// Don't add if already present or if it's just '.'
// Use path segment matching to avoid false positives (e.g., /opt/node vs /opt/node-v18)
const pathSegments = currentPath.split(path.delimiter);
if (nodeDir === '.' || pathSegments.includes(nodeDir)) {
// Normalize paths for comparison to handle mixed separators on Windows
const normalizedNodeDir = path.normalize(nodeDir);
const pathSegments = currentPath.split(path.delimiter).map((s) => path.normalize(s));
if (normalizedNodeDir === '.' || pathSegments.includes(normalizedNodeDir)) {
return currentPath;
}