nvm load does not work for Mac users
trouni opened this issue ยท 3 comments
The following lines to load nvm
do not work on Mac (seems like these are taken from the Ubuntu setup):
# Load nvm (to manage your node versions)
export NVM_DIR="$HOME/.nvm"
[ -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
These are the lines given by the terminal after running brew install nvm
from one of the students, but I believe there were some slightly different folders depending on the laptops (one of them was pointing to the homebrew
folder if I recall properly):
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
@trouni after further investigation, the official nvm
documentation states that "Homebrew installation is not supported". We should then install nvm
with the official script instead. This installation allows to use ~/.nvm/nvm.sh
as PATH for the nvm
command. I've just reverted the changes I had previously made and updated the setup instructions to use the script instead of brew
.