Here's a handy function to add to your ~/.zshrc
configuration, add it to the bottom of this file. When you change directory to one that has an .nvmrc
file, NVM will automatically download and install that version of Node.
Be sure you have NVM installed, and the NVM_DIR
is pointing at the proper directory per your installation.
export NVM_DIR="/usr/local/Cellar/nvm/0.37.0"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# place this after nvm initialization!
autoload -U add-zsh-hook