美文网首页node.js
mac下安装nvm

mac下安装nvm

作者: 记忆的北极 | 来源:发表于2020-12-21 15:53 被阅读0次

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

相关文章

网友评论

    本文标题:mac下安装nvm

    本文链接:https://www.haomeiwen.com/subject/fsgrnktx.html