Nvm: NVM sets PATH and NVM_HOME even after uninstall

Created on 22 Mar 2019  路  3Comments  路  Source: nvm-sh/nvm

  • Operating system and version:

Don't have NVM installed currently (Problem happened when uninstalling)
Mac OSX 10.14 Mojave
Installed using curl (from README).

  • nvm debug output:


    
    

  • nvm ls output:


    
    

  • How did you install nvm? (e.g. install script in readme, Homebrew):

install script in README.

  • What steps did you perform?/What happened?

I haven't use NVM in a while, but when I last did, my current default installed version was v10.15.0. So I decided to upgrade. I ran nvm install v10.15.3 and that worked fine. I then ran nvm alias default v10.15.3 and got the output default -> v10.15.3 (from memory, not sure what it actually was since I can't reproduce now). However, when I restarted my shell, the default version was still being shown as v10.15.0. I checked my ~/.bash_profile and decided to move the nvm lines to the bottom of the file. This had no effect when I restarted the shell. I decided to check my path (echo $PATH) and noticed that there was a ~/.nvm/versions/v10.15.0/bin (not sure if that's the correct path, still going by memory) in it, which I assume is why that version is in my default. Trying to change this again (using previous command) led to no avail. Even when I fully commented out my bash_profile and restarted, v10.15.0 was still in my path. I then decided to uninstall and then reinstall nvm using the instructions here. When I did this, nvm was uninstalled (command was gone, I couldn't run node or npm). However, when I tried to install it again using the command in the README, I got an error saying that NVM_HOME was already set: please check your profile. This made no sense, since I had deleted the folder and relevant lines from bash_profile. What's even more confusing is that the v10.15.0 was still in my path. I didn't add this myself (there is nothing in my bash_profile at least that would have added this). Now I'm in this weird phase where I can't install nvm even though its not on my computer. I even did a ripgrep on my home directory looking for v10.15.0 but couldn't find anything... with that text.

  • What did you expect to happen?

TBH, the default alias command should have worked, but since it didn't uninstalling didn't work. NVM should leave no traces of itself when I uninstall it according to the issue I linked to.

  • Is there anything in any of your profile files (.bashrc, .bash_profile, .zshrc, etc) that modifies the PATH?

Yeah, my bash_profile is full of setup for various programming languages (pyenv, rbenv, cargo, nimble, shards, dotnet core, and nvm). Nothing in .bashrc, .profile, and various other profile files located in /etc.

If any more info is needed, I can provide it tomorrow.

non-issue / invalid

Most helpful comment

Ok. I don't know WTF happened. I just opened my macbook, checked my PATH, and the nvm entry is no longer there. Even NVM_HOME is no longer set. I don't know how this solved itself (this computer was shut down too), but hey I can't complain.

I'm wondering if this was really a problem on NVM's part now... Looks like my terminal was just being weird. I'm now able to successfully install NVM and v10.15.3 (And as far as default switching goes, that also works now).

All 3 comments

Can you check your profile files, and .npmrc, for any mention of nvm?

Sure. I'll get back to you in a few hours (don't have device with me right now).

Ok. I don't know WTF happened. I just opened my macbook, checked my PATH, and the nvm entry is no longer there. Even NVM_HOME is no longer set. I don't know how this solved itself (this computer was shut down too), but hey I can't complain.

I'm wondering if this was really a problem on NVM's part now... Looks like my terminal was just being weird. I'm now able to successfully install NVM and v10.15.3 (And as far as default switching goes, that also works now).

Was this page helpful?
0 / 5 - 0 ratings