CentOS 7 安装Nodejs 16 LTS版
配置源
以下操作基于root用户
curl -fsSL https://rpm.nodesource.com/setup_lts.x | bash -
安装nodejs16 LTS长期维护版
sudo yum install -y nodejs
安装完成后通过命令验证版本
其他长期版本安装参考:
Node.js v18.x
# As root curl -fsSL https://rpm.nodesource.com/setup_18.x | bash - # No root privileges curl -fsSL https://rpm.nodesource.com/setup_18.x | sudo bash -
Node.js v16.x
# As root curl -fsSL https://rpm.nodesource.com/setup_16.x | bash - # No root privileges curl -fsSL https://rpm.nodesource.com/setup_16.x | sudo bash -
Node.js v14.x
# As root curl -fsSL https://rpm.nodesource.com/setup_14.x | bash - # No root privileges curl -fsSL https://rpm.nodesource.com/setup_14.x | sudo bash -
Node.js LTS (16.x)
# As root curl -fsSL https://rpm.nodesource.com/setup_lts.x | bash - # No root privileges curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
Node.js Current (18.x)
# As root curl -fsSL https://rpm.nodesource.com/setup_current.x | bash - # No root privileges curl -fsSL https://rpm.nodesource.com/setup_current.x | sudo bash -
Nodejs 卸载
# use `sudo` or run this as root yum remove nodejs rm -r /etc/yum.repos.d/nodesource*.repo yum clean all
更多参考:distributions/README.md at master · nodesource/distributions · GitHub
版权所有 © 【代码谷】 欢迎非商用转载,转载请按下面格式注明出处,商业转载请联系授权,违者必究。(提示:点击下方内容复制出处)
源文:《CentOS 7 安装Nodejs 16 LTS版》,链接:https://www.daimagu.com/article/1075.html,来源:【代码谷】
评论