Homebrew installs nvm but nvm can't be found afterwards?
Did you follow the instructions listed in the caveats?
[~] brew info nvm
nvm: stable 0.20.0, HEAD
https://github.com/creationix/nvm
Not installed
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/nvm.rb
==> Caveats
Add the following to $HOME/.bashrc, $HOME/.zshrc, or your shell's
equivalent configuration file:
source $(brew --prefix nvm)/nvm.sh
Node installs will be lost upon upgrading nvm. Add the following above
the source line to move install location and prevent this:
export NVM_DIR=~/.nvm
Without the extra config it doesn't look like it will find NVM by default..
There are TWO things you need to do. Follow the caveats shown after installing nvm via brew, and THEN you need to activate/reload the .bash_profile changes.
- Run
brew install nvm
- Follow caveats shown in console, mine were as follows, yours MAY be different!:
Add the following to ~/.bash_profile or your desired shell configuration file:
export NVM_DIR="$HOME/.nvm" . "$(brew --prefix nvm)/nvm.sh"
- Run
. ~/.bash_profile
to apply the changes you made to your .bash_profile file
While the accepted answer does technically work, it's worth noting that Homebrew installation is not officially supported by the nvm
package. The recommended way to avoid issues like those raised above is to apply either of the below methods of installation.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
# or wget:
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
source: https://github.com/creationix/nvm