How to Add Node JS Repository for Debian-Based OSes

November 11, 2017 | By the+gnu+linux+evangelist.

GNU/Linux Debian Adding Node JS Repository

Hi! The Guide shows you Step-by-step How to Add the Node JS Repository for Debian-Based GNU/Linux Systems.

And with this Node JS Repo Setup you’ll be able to Install both : 16.x LTS, 18.x LTS, and 20.x LTS.
Finally, this Node JS Debian Repository is valid also for:

  • Kali Linux
  • LMDE Linux
  • Deepin Linux
  • Parsix Linux
  • antiX Linux
  • MX Linux
  • SparkyLinux
  • MakuluLinux
  • Elive Linux
  • (You may only need to find the Corresponding Debian Parent Release)

How to Add Node JS Repository Debian - Featured
  1. 1. Terminal Getting-Started Guide

    How to QuickStart with Command Line on Debian GNU/Linux

    Console Debian Linux QuickStart Guide

    First Update the Apt Repo Sources with:

    sudo apt update

    Authenticate with the User Admin Pass.
    If Got “User is Not in Sudoers file” then see: How to Enable sudo.

  2. 2. Installing Dependencies

    Then to Install Required Software
    Run:

    sudo apt install -y ca-certificates curl gnupg
  3. 2. Adding GPG Key

    Now to Add Node.js Signing Key
    First, make the Target Directory with:

    sudo mkdir -p /etc/apt/keyrings

    And then to Setup it:

    curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
  4. 3. Setting Up NodeJS Repository

    Then Add Node JS Apt Repository
    Especially relevant: Node.js 18+ is supported only on Debian 10+ based Systems.
    Now for Node 20 Set the Env. Var. as:

    NODE_MAJOR=20

    And then run:

    echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list

    For Nodejs 16, and 18, change the NODE_MAJOR correspondly.
    Last, to Update the Apt Sources:

    sudo apt update
  5. 4. Installing NodeJS

    Now to Install NodeJS for MYDISTRO
    Simply play:

    sudo apt install nodejs
  6. 5. Getting Started Node Js

    How to Get Started with NodeJs on Debian GNU/Linux

    Node Js Debian QuickStart

QuickChic Theme • Powered by WordPress