mac下安装nvm

nvm的git地址

Git Install

If you have git installed (requires git v1.7.10+):

1,clone this repo in the root of your user profile
2,cd ~/ from anywhere then git clone https://github.com/nvm-sh/nvm.git .nvm
3,cd ~/.nvm and check out the latest version with git checkout v0.37.2
4,activate nvm by sourcing it from your shell: . nvm.sh
5,Now add these lines to your ~/.bashrc, ~/.profile, or ~/.zshrc file to have it automatically sourced upon login: (you may have to add to more than one of the above files)

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

然后查看一下nvm的版本


查看nvm版本

使用source命令来执行.sh的shell命令

然后把nvm软连接到系统环境中


软连接到系统环境bin中
nvm install 8.11.2  //安装8.11.2版本的node版本
use 8.11.2 //使用8.11.2版本的node
截屏2020-12-21 下午4.15.27.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容