Add nvm to zsh path

I'm only able to access nvm using bash, I'm trying to add it to my zshrc but unable to find it's install location.

I tried,

$ which nvm

but that does nothing.

2

1 Answer

The README for nvm here has some important hints for you. When installing manually, the doc suggests that you can add the following to your .zshrc file:

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

I suspect you are missing the first line. What does echo $NVM_DIR show you?

But even better, if you are using a plugin manager, such as Oh My Zsh (and you should be), you can simply install the zsh-nvm plugin by adding "nvm" to your list of plugins.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like