Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. Any help would be appreciated. Thanks.

like image 407
jordan Avatar asked Jun 03 '13 19:06

jordan


People also ask

Can npm install NVM?

Node Version Manager, more commonly called nvm, is the most popular way to install multiple versions of Node. js, but is only available for Mac/Linux and not supported on Windows. Instead, we recommend installing nvm-windows and then using it to install Node. js and Node Package Manager (npm).


2 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

https://github.com/creationix/nvm

like image 97
Deepak Lamichhane Avatar answered Sep 27 '22 17:09

Deepak Lamichhane


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 
like image 29
travis Avatar answered Sep 27 '22 19:09

travis