Recently, I've been trying to use nvm to manage node version. I successfully installed nvm on Mac OS Catalina(10.15.6) and I can switch between version from the terminal.
However, if I try to do the same thing with the integrated terminal on VSCode, I get zsh: command not found: nvm
Been looking for solutions or workaround, but there seems to be no relevant answers. Has anyone figure this out?
Thanks in Advance
When I installed VSCode, oh-my-zsh and NVM using homebrew I had the same issue. It appears to put wrong paths in ~/.zshrc (might be the same for bash).
Solution:
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
source ~/.zshrc
or source ~/.bashrc
in terminal depending on what you use.I figured this out so I'll post an answer.
The reason why I get the zsh: command not found
error was because I had Visual Studio Code placed under the Documents directory.
It seems like VSCODE terminal works properly when it is set under the Applications folder .
Make sure to place VSCode under Application folder.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.