Rocky Linux 9.0にNode.js 18をインストールする方法

環境
OSバージョンの確認

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# cat /etc/redhat-release
Rocky Linux release 9.0 (Blue Onyx)
# cat /etc/redhat-release Rocky Linux release 9.0 (Blue Onyx)
# cat /etc/redhat-release
Rocky Linux release 9.0 (Blue Onyx)

Node.js 18のインストール手順
1.システムパッケージを更新します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo dnf upgrade --refresh
# sudo dnf upgrade --refresh
# sudo dnf upgrade --refresh

2.必要なパッケージをインストールします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo dnf install curl -y
# sudo dnf install curl -y
# sudo dnf install curl -y

3. Node.js 18のインストール
リポジトリをインポートします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# curl -fsSL https://rpm.nodesource.com/setup_18.x | sudo -E bash -
# curl -fsSL https://rpm.nodesource.com/setup_18.x | sudo -E bash -
# curl -fsSL https://rpm.nodesource.com/setup_18.x | sudo -E bash -

nodeをインストールします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo dnf install nodejs -y
# sudo dnf install nodejs -y
# sudo dnf install nodejs -y

4.nodeバージョンを確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# node --version
v18.6.0
# node --version v18.6.0
# node --version
v18.6.0

 

Rocky Linux 9

Posted by arkgame