Persiapan Sebelum Install Node Js
Kita perlu mengupdate packages dan install curl
1
| sudo apt update && sudo apt install -y curl
|
Install Node Js Sesuai Pilihan Versi
v14.x (LTS)
1
2
| curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt install -y nodejs
|
v12.x (LTS)
1
2
| curl -fsSL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt install -y nodejs
|
v16.x
1
2
| curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install -y nodejs
|
v18.x
1
2
| curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs
|
Cara Uninstall Node Js
Jika anda ingin meng-uninstall nodejs, lakukan perintah berikut:
1
2
| sudo apt autoremove nodejs
sudo rm /etc/apt/sources.list.d/nodesource.list
|
Referensi
ItzGeek - How to Install Node Js and Npm On Debian 11