node版本管理工具。可以在多个node版本中进行切换,降低了升级node时的成本。
https://github.com/nvm-sh/nvm/blob/master/README.md
https://gitee.com/mindblowing/nvm
https://gitee.com/mindblowing/nvm/blob/master/README.md
安装nvm时,以那个用户使用那个用户安装为基准
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
$ nvm ls-remote
$ nvm use v8.16.2
$ nvm use 16
Now using node v16.9.1 (npm v7.21.1)
$ node -v
v16.9.1
$ nvm use 14
Now using node v14.18.0 (npm v6.14.15)
$ node -v
v14.18.0
$ nvm install 12
Now using node v12.22.6 (npm v6.14.5)
$ node -v
v12.22.6