使用brew install nvm命令安装nvm使用时,报错zsh: command not found: nvm
方案一:相关链接:https://www.jianshu.com/p/e945bb48593e
方案二:https://www.jianshu.com/p/bdbc51fa8ce6
但是每次关闭终端后,又得输入一次,很烦人
终极大招,最好是配置到zsh文件中,如下
vi ~/.zshrc
添加配置代码,进行保存:wq
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && \. "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion