node.jsterminalnvm

Node Version Manager install - nvm command not found


I am trying to install NVM as per these instructions

I typed in this command in terminal:

$ curl https://raw.github.com/creationix/nvm/master/install.sh | sh

After running the install, I restart the terminal and attempt to install Node.js with this command:

$ nvm install 0.8

but I get the response:

-bash: nvm: command not found

I'm not sure what I am doing wrong here.

Additional Info:

I've been looking around for solutions from other posts and forums. I found another solution using

$ git clone git://github.com/creationix/nvm.git ~/.nvm

but this times out every time I attempt that.


Solution

  • Check your .bash_profile, .zshrc, or .profile file. You most likely had a problem during the installation.

    You should have the following at the end of one of those files.

    [[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh  # This loads NVM
    

    The . $HOME/.nvm/nvm.sh is the same as source $HOME/.nvm/nvm.sh

    See: Sourcing a File

    You can also check to see if you have a .nvm folder.

    ls -a | grep .nvm
    

    If you're missing that folder then the installation failed to run the git command. This could be due to being behind a proxy. Try running the following instead.

    git clone http://github.com/creationix/nvm.git .nvm