Debian11.2にNode.js、NPMをインストールする

環境
# cat /etc/debian_version
11.2

Node.jsのインストール
1.システムを更新します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo apt update
# sudo apt upgrade -y
# sudo apt install build-essential -y
# sudo apt update # sudo apt upgrade -y # sudo apt install build-essential -y
# sudo apt update
# sudo apt upgrade -y
# sudo apt install build-essential -y

2.リポジトリを追加します

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

3.Node.jsをインストールします

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

3.node.jsのバージョンを確認します

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

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

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# npm -v
8.5.1
# npm -v 8.5.1
# npm -v
8.5.1

 

Debian 11

Posted by arkgame