mac 中安装nvm
时间: 2023-11-23 21:57:11 浏览: 112
Mac中安装nvm的教程分享
以下是在Mac中安装nvm的步骤:
1.打开终端并输入以下命令以安装Homebrew:
```shell
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
2.使用Homebrew安装nvm:
```shell
brew install nvm
```
3.配置nvm环境变量:
```shell
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bash_profile
echo 'source /usr/local/opt/nvm/nvm.sh' >> ~/.bash_profile
```
4.重新加载bash配置文件:
```shell
source ~/.bash_profile
```
5.使用nvm安装Node.js:
```shell
nvm install node
```
6.检查Node.js版本:
```shell
node -v
```
输出应该是已安装的Node.js版本号。
阅读全文