Skip to content

Conversation

junis84
Copy link

@junis84 junis84 commented Jun 25, 2025

🎯 Problem

Currently, Claudia may not properly detect Claude binaries installed through NVM (Node Version Manager) when users have multiple Node.js versions installed. This can lead to:

  • Wrong Claude version being selected
  • Claude not found errors despite being installed
  • Inconsistent behavior across different NVM environments

🔧 Solution

This PR enhances the Claude binary detection logic by:

Key Changes:

  • Added NVM_BIN environment variable detection - Prioritizes the currently active NVM environment
  • Improved priority system - Places nvm-active installations at priority level 4 (just before other NVM versions)
  • Consolidated NVM logic - All NVM-related detection now happens in find_nvm_installations()
  • Maintained backward compatibility - No breaking changes to existing functionality

Technical Details:

// New: Check NVM_BIN environment variable first
if let Ok(nvm_bin) = std::env::var("NVM_BIN") {
    let claude_path = PathBuf::from(&nvm_bin).join("claude");
    // ... detect Claude in active NVM environment
}

- Add support for NVM_BIN environment variable detection
- Prioritize currently active NVM environment over other installations
- Consolidate NVM-related logic in find_nvm_installations function
- Maintain backward compatibility with existing detection methods

This change helps users who manage Node.js versions with NVM by
ensuring Claudia detects the Claude binary from the currently
active Node.js environment, resolving issues where the wrong
Claude version might be selected despite having multiple NVM
installations available.
@tebayoso
Copy link

Check #3 is not just detecting the nvm, you need to add the selector.

@movax01h
Copy link

Hi there! Seems I create a duplicate PR #61
Its working for me right now, decline it if you don't need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants