Installing NodeJS 20 on Debian

Sun Nov 05 2023

Here is a short blogpost about how you can install the NodeJS 20 on Debian 12 using Nodesource.

Importing GPG key

To add the nodesource repos to Debian, we need to import their GPG key first and we can use the command

sudo mkdir -p /etc/apt/keyrings
curl -fsSL | sudo gpg --keyserver --dearmor -o /etc/apt/keyrings/nodesource.gpg

to import the nodesource pgp key.

Adding repository

echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list

Installing NodeJS

Now we can use the command

sudo apt update && sudo apt install nodejs

to install the NodeJS. Than you can check it with the command node --version and we're done!

Reply via E-Mail

Thank You!

Batuhan Yılmaz - 05.11.2023 - 33/100