1、获取nodejs 资源
curl --silent --location https://rpm.nodesource.com/setup_5.x | bash -
- curl --silent --location https://rpm.nodesource.com/setup_5.x | bash -
curl --silent --location https://rpm.nodesource.com/setup_5.x | bash -
2、安装
yum install -y nodejs
- yum install -y nodejs
yum install -y nodejs
测试是否安装成功
node -v
# v4.4.0
npm -v
# 2.14.20
- node -v
- # v4.4.0
- npm -v
- # 2.14.20
node -v
# v4.4.0
npm -v
# 2.14.20
3、安装cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
- npm install -g cnpm --registry=https://registry.npm.taobao.org
npm install -g cnpm --registry=https://registry.npm.taobao.org