Mac 安装nvm教程

mac安装nvm首先一定要确定本机中是否已经安装了nvm 和 node,参考本教程之前请先卸载。

1、打开终端,进入系统更目录: cd

2、在根目录文件下配置 .dash_profile,

touch .dash_profile

open .dash_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 bash_completion

3、在根目录执行命令:

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

4、安装完成之后一定要退出终端重新打开才能生效。

如图:

 

注意:以上步骤请一定按照顺序执行。

猜你喜欢

转载自blog.csdn.net/weixin_44510655/article/details/127322018