Command nvm not found and Command node not found after already installed nvm on MacOS?
Ziyi Chu
Posted on September 17, 2024
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
💖 💪 🙅 🚩
Ziyi Chu
Posted on September 17, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
watercooler Why does a reboot make your PC run SO much faster than running all the cleaning tools you can possibly imagine?
November 30, 2024