Search code examples
terminalzshoh-my-zsh

Unable to add 'nvm' plugin to zsh through oh my zsh


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?


Solution

  • 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 :)