在AlmaLinux OS 9上安装Nodejs 20(AppStream)

首先

使用应用流(AppStream)在AlmaLinux OS 9上安装Node.js 20。

支持

若采用本方法进行实施,则根据Red Hat企业版Linux应用程序流的生命周期 – Red Hat客户门户网站,预计2026年4月将终止技术支持。
在此日期之后,可能不会再针对报告的漏洞和问题进行修复。

记录

安装

# cat /etc/redhat-release
AlmaLinux release 9.3 (Shamrock Pampas Cat)

# yum module list nodejs
Last metadata expiration check: 0:00:25 ago on Thu Nov 23 05:24:14 2023.
AlmaLinux 9 - AppStream
Name                Stream              Profiles                                          Summary
nodejs              18                  common [d], development, minimal, s2i             Javascript runtime
nodejs              20                  common [d], development, minimal, s2i             Javascript runtime

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

# yum module install -y nodejs:20
... 略

不同的确认方式

# which node
/usr/bin/node

# /usr/bin/node -v
v20.9.0

# yum info nodejs
Last metadata expiration check: 0:01:30 ago on Thu Nov 23 05:24:14 2023.
Installed Packages
Name         : nodejs
Epoch        : 1
Version      : 20.9.0
Release      : 1.module_el9.3.0+48+1cf146a1
Architecture : x86_64
Size         : 50 M
Source       : nodejs-20.9.0-1.module_el9.3.0+48+1cf146a1.src.rpm
Repository   : @System
From repo    : appstream
Summary      : JavaScript runtime
URL          : http://nodejs.org/
License      : MIT and ASL 2.0 and ISC and BSD
Description  : Node.js is a platform built on Chrome's JavaScript runtime
             : for easily building fast, scalable network applications.
             : Node.js uses an event-driven, non-blocking I/O model that
             : makes it lightweight and efficient, perfect for data-intensive
             : real-time applications that run across distributed devices.
广告
将在 10 秒后关闭
bannerAds