nodejs安装从未这么简单
1、nodejs版本设置?
curl -fsSL https://rpm.nodesource.com/setup_16.x | sudo bash -
其他版本如下:
* https://rpm.nodesource.com/setup_16.x --- Node.js 16 "Gallium" (deprecated)* https://rpm.nodesource.com/setup_18.x --- Node.js 18 "Hydrogen" (Maintenance)
* https://rpm.nodesource.com/setup_19.x --- Node.js 19 "Nineteen" (deprecated)
* https://rpm.nodesource.com/setup_20.x --- Node.js 20 LTS "Iron" (recommended)
* https://rpm.nodesource.com/setup_21.x --- Node.js 21 "Iron" (current)
2、初始化nodejs
sudo yum install -y nodejs
3、nodejs版本查询
node -v
npm --v