I'm using homebrew
and oh-my-zsh
on a fresh OSX 10.10.1 install. I got nvm
via homebrew
and then attempted to run it but says - zsh: command not found: nvm
Any idea what the problem is? I was able to install and use git just fine...
UPDATED 9/20/2019
As stated by more recent answers from DarkPurple141 and Elise van Looij. nvm
doesn't appear to be compatible with homebrew
. This is also stated in the official nvm-sh repo located here.
Homebrew installation is not supported. If you have issues with homebrew-installed nvm, please brew uninstall it, and install it using the instructions below, before filing an issue.
Note: If you're using zsh you can easily install nvm as a zsh plugin. Install zsh-nvm and run nvm upgrade to upgrade.
The following steps should help:
$ brew uninstall nvm
$ brew cleanup
(just for good measure)
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
Check that nvm was installed correctly by running $ command -v nvm
.
4.a If the response is anything other than $ nvm
, add the following two lines to the ~/.bash-profile file:
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
4.b Restart your computer (you can try closing Terminal and restarting it first)
4.c $ command -v nvm should now return
nvm`
Now update Node.js with $ nvm install --lts
Update npm: $ nvm install-latest-npm
$ npm install --global mocha
. Finally, success! Well, for me and I hope for you too.
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..