跳到主要内容

NodeSource Node.js 安装指南

NodeSource

本仓库包含通过 .rpm 和 .deb 安装 NodeSource N|Solid 和 Node.js 二进制分发的说明及其设置和支持脚本。

最新更新 ⚠️​

我们发布了分发仓库 nodesource/distributions 的重要变更:

  • 包变更:DEB 和 RPM 包现在使用 nodistro 代号。不再将安装程序与特定版本绑定。
  • 安装脚本:安装脚本已回归,功能更强大。
  • RPM 包签名密钥:改用 SHA256 签名,提供更好的社区支持。

Debian/Ubuntu 发行版​

支持的架构​

  • amd64 (64 位)
  • armhf (ARM 32 位硬浮点,ARMv7 及以上)
  • arm64 (ARM 64 位,ARMv8 及以上)

支持的版本​

Ubuntu 版本​

发行版名称Node 18+Node 20+Node 21+Node 22+Node 23+Node 24+
Ubuntu 18.04❌❌❌❌❌❌
Ubuntu 20.04+✅✅✅✅✅✅

Debian 版本​

发行版名称Node 18+Node 20+Node 21+Node 22+Node 23+Node 24+
Debian 10+✅✅✅✅✅✅

[!NOTE] 如需在不支持的 Linux 版本上运行 Node.js,请联系 NodeSource 获取企业支持。


安装指南​

Node.js 23.x​

# Ubuntu/Debian 通用
sudo apt install -y curl
curl -fsSL https://deb.nodesource.com/setup_23.x | sudo -E bash -
sudo apt install -y nodejs
node -v

卸载指南​

# 卸载 Node.js
sudo apt purge nodejs
sudo rm -rf /etc/apt/sources.list.d/nodesource*

# 卸载 N|Solid
sudo apt purge nsolid

Enterprise Linux 发行版​

支持的架构​

  • x86_64 (64 位)
  • arm64 (ARM 64 位)

支持的版本​

Redhat/Fedora​

发行版名称Node 18+Node 20+Node 21+Node 22+Node 23+
RHEL 8+✅✅✅✅✅
Fedora 29+✅✅✅✅✅

安装指南​

Node.js 23.x​

# Redhat/Fedora 通用
sudo yum install -y curl
curl -fsSL https://rpm.nodesource.com/setup_23.x | sudo bash -
sudo yum install -y nodejs
node -v

卸载指南​

# 卸载 Node.js
sudo yum remove nodejs
sudo rm -rf /etc/yum.repos.d/nodesource*

# 卸载 N|Solid
sudo yum remove nsolid

由 NodeSource 团队提供支持