MAC之zsh终端使用nvm安装指定版本node

安装brew

终端上运行

$ /usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

安装NVM

$ brew install nvm

安装完成之后打开shell的配置文件

$ cd ~
$ vim ~/.zshrc

# 如果是bash的话执行
$ vim .bash_profile

在文件里添加以下命令

export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh

然后重新source

$ source ~/.zshrc

# 如果是bash的话执行
$ source .bash_profile

使用nvm安装node

$ nvm ls-remote 查看 所有的node可用版本
$ nvm install xxx 下载你想要的版本
$ nvm use xxx 使用指定版本的node
$ nvm alias default xxx 每次启动终端都使用该版本的node

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...