一、选择node.js各个版本

V10.x: 
#curl --silent --location https://rpm.nodesource.com/setup_10.x | bash -

V9.x: 
#curl --silent --location https://rpm.nodesource.com/setup_9.x | bash -

V8.x: 
#curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -

V7.x:
#curl --silent --location https://rpm.nodesource.com/setup_7.x | bash -

V6.x:
#curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -

V5.x:
#curl --silent --location https://rpm.nodesource.com/setup_5.x | bash -

二、安装Node.js

[root@test1 tmp]# curl --silent --location https://rpm.nodesource.com/setup_10.x | bash -
[root@test1 tmp]# sudo yum install -y nodejs

[root@test1 tmp]# curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
[root@test1 tmp]# sudo yum install yarn -y  //涉及到使用yarn的话可以进行安装

[root@test1 tmp]# node -v       //查看nodejs版本
v10.16.3

三、安装cnpm

[root@test1 tmp]# npm install cnpm -g --registry=https://registry.npm.taobao.org
[root@test1 tmp]# cnpm install pm2 -g       //根据自己需求进行安装
最后修改日期: 2019年10月15日

作者

留言

撰写回覆或留言

发布留言必须填写的电子邮件地址不会公开。