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 | Sh After Running the Install, I Restart the Terminal and...
I am trying to install NVM as per these instructions
I typed in this command in terminal:
$ curl | 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:// ~/.nvm
but this times out every time I attempt that. Any help would be appreciated. Thanks.
32 Answers
I think you missed this step:
source ~/.nvm/nvm.sh
You can run this command on the bash OR you can put it in the file /.bashrc or ~/.profile or ~/.zshrc to automatically load it
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 .nvm
This works for me:
Before installing
nvm, run this in terminal:touch ~/.bash_profileAfter, run this in terminal:
curl -o- | bashImportant... - DO NOT forget to Restart your terminal OR use command
source ~/.nvm/nvm.sh(this will refresh the available commands in your system path).In the terminal, use command
nvm --versionand you should see the version
Must Read
Quick answer
Figure out the following:
- Which shell is your terminal using, type in:
echo $0to find out (normally works) - Which start-up file does that shell load when starting up (NOT login shell starting file, the normal shell starting file, there is a difference!)
- Add
source ~/.nvm/nvm.shto that file (assuming that file exists at that location, it is the default install location) - Start a new terminal session
- Profit?