node 环境部署
1.下载node.js
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 -
2.yum安装node.js
yum install -y nodejs
3.查看node.js版本
node -v
4.安装PM2
npm i pm2 -g
5. 设置默认安装源
npm config set registry https://registry.npm.taobao.org
快捷复制
yum install -y nodejs
npm config set registry https://registry.npm.taobao.org
npm i pm2 -g
node -v
解决项目部署时权限不足问题
npm install --unsafe-perm=true --allow-root