1安装版本管理工具git

yum install git

查看git版本

git --version

2 安装Node.js版本管理工具nvm

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

或者

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

还可以用下面这种方法

git clone git://github.com/creationix/nvm.git ~/nvm

验证安装

command -v nvm

设置nvm自动运行

echo "source ~/nvm/nvm.sh" >> ~/.bashrc
source ~/.bashrc

查询Node.js版本

nvm list-remote

安装Node.js版本

nvm install v7.6.0

切换Node.js版本

nvm use v7.6.0

升级npm

npm -g install npm@5.7.1

更多nvm用法可参考Node Version Manager

相关文章:

  • 2021-05-30
  • 2021-06-12
  • 2021-11-29
  • 2022-12-23
  • 2021-11-19
  • 2021-09-29
  • 2021-10-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-15
  • 2021-08-28
  • 2021-07-19
  • 2021-06-19
  • 2022-01-17
相关资源
相似解决方案