3

I have recently just started using wsl and zsh for dev purposes and I have tried to add the nvm through as a plugin in zsh through the ~/.zshrc file. I've added, saved and reloaded the terminal several times and tries the nvm command and it comes out with the 'zsh: command not found: nvm' error.

Any suggestions?

Ardent Coder
  • 3,777
  • 9
  • 27
  • 53
  • If `source ~/.zshrc` doesn't work, have a look at [this answer](https://stackoverflow.com/questions/47009776/how-to-run-nvm-in-oh-my-zsh/51696357). – Josh Friedlander May 24 '20 at 13:11

1 Answers1

2

You can add nvm's loading script to ~/.zshrc. This instruction can be found on the readme.

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

You can test with:

which node

Hope this works :)

Max Collier
  • 573
  • 8
  • 24