Skip to content

emka.web.id

menulis pengetahuan – merekam peradaban

Menu
  • Home
  • Tutorial
  • Makalah
  • Ke-NU-an
  • Kabar
  • Search
Menu

How to Install Node.js and npm on Debian 11

Posted on August 29, 2021

Node.js is an open-source, cross-platform JavaScript runtime environment for developing server-side 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.

Here, we will see how to install Node.js on Debian 11.

Install Node.js on Debian

You can install Node.js using NodeSource, NVM, and Debian repository. So, follow any one of the methods you think is easier to install Node.js.

You may need to install the curl package before proceeding further.

sudo apt update && sudo apt install -y curl

Install Node.js using NodeSource

Nodesource is a leading commercial enterprise software company with a mission to build and support a sustainable open source community around Node.js, JavaScript, and NPM.

At the time of writing this article, the below versions of Node.js is available for user. You can visit the official page to find the supported Node.js versions.
v14.x (Active LTS)v12.x (Maintenance LTS)v16.x (Latest Version)v14.x (LTS)

curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - sudo apt install -y nodejs

v12.x (LTS)

curl -fsSL https://deb.nodesource.com/setup_12.x | sudo -E bash - sudo apt install -y nodejs

v16.x

curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - sudo apt install -y nodejs

Install Node.js using NVM

nvm is a version manager for Node.js, and it helps us install Node.js per user and invokes it per shell. Also, it allows you to install and use multiple versions of node.js in parallel.

Install nvm by running the below command.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

Once the nvm is installed, exit the current session and log in back to use the nvm command.

Use the below command to verify the nvm installation.

nvm -v

Output:

0.38.0

Now, you can use the nvm command to install the latest stable version of Node.js, the latest LTS version, a specific version of Node.js.

# Latest Stable Version nvm install node # Latest LTS Version nvm install --lts # Specific Version nvm install 12.22.5

Use nvm ls-remote to list the available Node.js version to install, nvm use node/–lts/ to change to another Node.js version, nvm alias default to set the default Node.js version.
Install Node.js using Debian Repository

Node.js is also available in the Debian repository, and you can install it along with npm (Node Package Manager)using the below command.

Node.js v12.x (LTS) and npm v7.5.x are available in the Debian OS repository when writing this article.

sudo apt install -y nodejs npm 

Check Node.js Installation

Check the Node.js version using the following command.

node -v

Output: (NodeJS v14.x)

v14.17.5

Check the npm version.

npm -v

Output:

6.14.14

Install Build Tools

You will need to install development tools to compile and install native addons from npm.

sudo apt install -y build-essential 

Sumber: disini

Terbaru

  • Google Akan Memperkenalkan Autofill Google Wallet di Chrome untuk Pembayaran Lebih Mudah
  • Google Pixel Akan Memperkenalkan Launcher Device Search Baru, Lebih Cepat dan Pintar
  • Hacker Serang Bug VPN di ArrayOS AG untuk Menanam Web Shell
  • Cara Menonaktifkan Error “ITS Almost time to restart in Windows”
  • Google Fi Mendukung Panggilan Telepon RCS Melalui Web, Lebih Mudah dan Efisien
  • Data Breach Marquis: Hajar Lebih Dari 74 Bank dan Koperasi AS
  • Google Search Akan Adopsi ‘Continuous Circle’ untuk Hasil Pencarian Terjemahan, Lebih Cerdas dan Kontekstual
  • Rusia Memblokir Roblox Karena Distribusi ‘Propaganda LGBT’
  • Google Gemini Redesain Web Total di Desember 2025, Fokus UX yang Lebih Baik
  • Apa itu Google Workspace Studio? Tool Baru untuk Pembuat Konten?
  • Cara Menggunakan Xbox Full-Screen Experience di Windows
  • Korea Tahan Tersangka Terkait Penjualan Video Intim dari Kamera CCTV yang Diretas
  • Kebocoran Galaxy Buds 4 Mengungkap Desain dan Fitur Baru, Mirip Apple?
  • Sudah Update Windows KB5070311 dan Apa Saja Yang Diperbaiki?
  • Cara Menonaktifkan Fitur AI Actions (Tindakan AI) di Menu Windows Explorer
  • Microsoft Edge AI vs. OpenAI’s Atlas Browser: Perbandingan dan Perbedaan Utama
  • Cara Memasang Folder Sebagai Drive di Windows 11
  • Cara Memperbaiki Error 0xC1900101 0x40021 pada Update Windows 11
  • Malware Glassworm Serang Lagi VSCode, Hati-hati!
  • Walmart dan Google Bermitra untuk Kamera Rumah Google Home: Pengalaman Langsung
  • Gemini Dapat Bisa Atur Perangkat Rumah Melalui Home Assistant Pakai Suara, Desember 2025
  • Asahi, Produsen Bir Jepang, Akui Kebocoran Data 15 Juta Pelanggan
  • Google Messages Ada Fitur Baru: Pesan Grup, Mode Gelap dan Integrasi dengan Google Duo
  • 5 Laptop ASUS Terbaik dengan Tampilan Mewah dan Build Quality Premium
  • Pria di Balik Serangan ‘Twin Wifi’ Mencuri Wifi, Dikenakan Hukuman 7 Tahun Penjara
  • Google Kembangkan Fitur Baru untuk Tugas di Keep, Lebih Terintegrasi dengan Kalender
  • Google Akan Luncurkan Laptop dan Ponsel Android Baru di Tahun 2025: Murah & Spesifikasi Tinggi
  • Samsung Galaxy Z-Fold Tri-Fold: Harga dan Spesifikasi Resmi Terungkap
  • Federasi Sepak Bola Prancis (FFF) Mengungkap Pelanggaran Data Setelah Serangan Siber
  • Google Perbarui Desain Akun Google Web, Fokus pada Kemudahan Penggunaan dan Integrasi
  • Google Akan Memperkenalkan Autofill Google Wallet di Chrome untuk Pembayaran Lebih Mudah
  • Google Pixel Akan Memperkenalkan Launcher Device Search Baru, Lebih Cepat dan Pintar
  • Hacker Serang Bug VPN di ArrayOS AG untuk Menanam Web Shell

©2025 emka.web.id | Design: Newspaperly WordPress Theme