NVM Node Version Switch Breaks Claude Code Installation on Windows
When switching between node versions on Windows with NVM for Windows, I lose access to Claude Code. It seems to be installed for the specific version. Therefore I wanted to migrate the installer, but that fails without any helpful error messages, even with the debug flag enabled.
I also couldn't find any help online for this issue.
This is not with WSL, but native Windows.
Yeah, it doesn't play nice with nvm at all. claude doctor reports some things as unknown and things such as the initial dialog "Do you trust..." don't get saved.
The native installer for Windows has some issues at the moment, we'll have an update here soon.
Same issue on macOS with nvm as well.
@phillipphoenix the native installer should be working better with Windows as of v1.0.58 - want to give that a try?
@phillipphoenix the native installer should be working better with Windows as of v1.0.58 - want to give that a try?
I just tried it, and the installation ran successfully through all the steps. But the alias doesn't seem to work properly. It said it was successful, but I get an error when trying to run the command. Also after restarting the terminal.
So two steps forward and one step back? 😅
EDIT:
After some more research, it seems the problem is that it first of all states that alias setup is complete (but it shows how to manually set it up). Then it also shows how to set it up in .bashrc, which does not work with powershell. This is the output of that step:
Alias setup complete
To configure claude, add this line to your C:\Users\pphoe\.bashrc:
alias claude="C:\Users\pphoe\.claude\local\claude"
Then run: source C:\Users\pphoe\.bashrc
Since the script is a bash script it can't be run directly with powershell, but I got around it by adding this to my powershell profile file:
# Claude Code alias
function claude { & "C:\Program Files\Git\bin\bash.exe" "C:\Users\pphoe\.claude\local\claude" $args }
It runs it with Git Bash. But it would be nice to be able to run it directly and have the alias added automatically during migration, if possible.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.