Mac安装nvm后:--nvm command not found

来源:互联网 发布:数据与营销 编辑:程序博客网 时间:2024/06/05 15:38

使用

brew install nvm

安装之后

nvm --version

出现error

brew uninstall nvm

卸载。使用另外的方法安装nvm:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash

安装之后,在.bash-profile中添加:

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 

执行:

source .bash-profile

之后:

nvm --version