安装:

# 安装 curl
sudo apt install curl
# 安装 git
sudo apt install git
# 安装 nvm
bash -c "$(curl -fsSL https://gitee.com/RubyMetric/nvm-cn/raw/main/install.sh)"
  • 重开终端,或重新打开 ssh 窗口

使用:

命令行作用
nvm ls已安装的列表
nvm ls-remote所有可安装版本
nvm install v12.20.1安装某个版本Node
nvm use 12.20.1切换Node版本
node -vnode.js 版本
nvm-update更新nvm

卸载:

bash -c "$(curl -fsSL https://gitee.com/RubyMetric/nvm-cn/raw/main/uninstall.sh)"