Why do we see these types of errors?
Command nvm not found
Command node not found
Because we didn't add the source lines to the correct shell startup script, that is, ~/.bash_profile, ~/.zshrc, ~/.profile, or ~/.bashrc, depending on the shell program you are using.
How do you find these startup scripts?
These files that begin with a "." are usually hidden, so you can't find them in the Finder, or by "ls" command.
Find hidden files in the Finder Window: Press Command-Shift-period
To find hidden files in terminal:
cd ~
ls -a ~
Source lines to add
//source line added
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
Reference:
1.https://blog.logrocket.com/how-switch-node-js-versions-nvm/
2.https://discussions.apple.com/thread/254493189?sortBy=rank
Top comments (0)