[英]zsh: command not found: nvm
Recently, I've been trying to use nvm to manage node version.最近一直在尝试使用nvm来管理node版本。 I successfully installed nvm on Mac OS Catalina(10.15.6) and I can switch between version from the terminal.
我在 Mac OS Catalina(10.15.6) 上成功安装了 nvm,我可以从终端切换版本。
However, if I try to do the same thing with the integrated terminal on VSCode, I get zsh: command not found: nvm
但是,如果我尝试在 VSCode 上使用集成终端执行相同的操作,我会得到
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.当我使用自制软件安装 VSCode、oh-my-zsh 和 NVM 时,我遇到了同样的问题。 It appears to put wrong paths in ~/.zshrc (might be the same for bash).
它似乎在 ~/.zshrc 中放置了错误的路径(对于 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.source ~/.zshrc
或source ~/.bashrc
。 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.我收到
zsh: command not found
错误的原因是因为我将 Visual Studio Code 放在了 Documents 目录下。
It seems like VSCODE terminal works properly when it is set under the Applications folder .当 VSCODE 终端设置在Applications 文件夹下时,它似乎可以正常工作。
Make sure to place VSCode under Application folder.确保将 VSCode 放在应用程序文件夹下。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.