NVM doesn't stick to alias default with ZSH (oh-my-zsh)

Add below to the end of .zshrc

export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh

Please note that must be in the end, i don't know why


I have it working now. Reinstalled oh-my-zsh.

I am not sure what has changed. It seems I do need to keep the nvm plugin enabled for it to work.

Without the plugin I tried putting the nvm startup command in .zprofile

export NVM_DIR="/Users/me/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm

Although the file is loaded on creating a new shell, it didn't seem to enable NVM properly.

Also I noticed that if I make a mistake in the zsh plugin configuration in .zshrc, there is no error and the plugins simply won't work. So this is something to be careful about I guess. For example I used comma's by accident and then the plugins break without warning:

plugins=(git, gitflow, nvm)

I am using OSX 10.11.6 with Hyper and Oh My Zsh. I had to uninstall nvm that was installed through homebrew, reinstall it through the curl command, and then add this line to the very bottom for it to work correctly. I am sure that is something with all of my plugins/setting/blah but this is what made it work for me:

source "$NVM_DIR/nvm.sh"

at the very end of my the ~/.zshrc file

Tags:

Zsh

Nvm

Oh My Zsh