I think you missed this step:
source ~/.nvm/nvm.sh
You can run this command on the bash OR you can put it in the file /.bashrc or ~/.profile or ~/.zshrc to automatically load it
https://github.com/creationix/nvm
Answer from Deepak Lamichhane on Stack OverflowI think you missed this step:
source ~/.nvm/nvm.sh
You can run this command on the bash OR you can put it in the file /.bashrc or ~/.profile or ~/.zshrc to automatically load it
https://github.com/creationix/nvm
Check your .bash_profile, .zshrc, or .profile file. You most likely had a problem during the installation.
You should have the following at the end of one of those files.
[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh # This loads NVM
The . $HOME/.nvm/nvm.sh is the same as source $HOME/.nvm/nvm.sh
See: Sourcing a File
You can also check to see if you have a .nvm folder.
ls -a | grep .nvm
If you're missing that folder then the installation failed to run the git command. This could be due to being behind a proxy. Try running the following instead.
git clone http://github.com/creationix/nvm.git .nvm
How to properly install nvm Mac when it's already installed but not recognized? - LambdaTest Community
nvm is broken after I installing oh-my-zsh?
zsh: command not found: node
The system does not recognize nvm straight after I've installed it? How do i fix it?
Videos
Added this line to ./zshrc file. Working great. Original source: https://github.com/lukechilds/zsh-nvm
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
I was having the same problem after exiting the terminal the nvm command was not found. So to fix this you have to add
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
this line of code on your .zshrc file
to do that type vim ~/.zshrc than add the following lines in the bottom and to save the file click ctrl than press :wq! to save file in vim you can also use nano
The problem seems to be that gnome terminal does not load ~/.profile on startup, and there is where NVM is added to the path. You have two choices:
- Go to "Edit" -> "Profile Preferences" in terminal and activate "Run command as a login shell". Then close and open again the terminal.
Add this at the end of
~/.bashrc:[[ -s /home/$USER/.nvm/nvm.sh ]] && . /home/$USER/.nvm/nvm.sh
i think you have miss this step
source ~/.nvm/nvm.sh
You can run this command on the bash OR you can but under the file /.bashrc or ~/.profile to automatically load
REF::https://github.com/creationix/nvm