/安装nodejs
yum install epel-release
yum install nodejs
//安装yarn
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
#curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
sudo yum install yarn
升级nodejs
sudo npm install n -g
sudo n stable
vi ~/.bash_profile
添加
export PATH=/usr/local/bin/:$PATH
再执行
source ~/.bash_profile
node --version
升级npm
sudo npm i -g npm
npm -version