Hari ini aku mencoba mencari cara untuk install Node.js di linux keluarga debian. Iseng aku mencoba bertanya ke AI yang baru baru ini baru populer & memudahkan orang untuk mencari cara, mencari solusi untuk memecahkan persoalan/case project, salah satu contohnya melakukan instalasi node.js dengan bash script, otomasi ini ceritanya, tidak perlu mengetik ulang, bisa dipakai lagi di waktu yang lain.
![]()  | 
| bash script | 
Sure! Here's a bash script to install Node.js on Linux:
#!/bin/bash# add Node.js PPAcurl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -# install Node.js and npmsudo apt-get install -y nodejs# check Node.js and npm versionsnode -vnpm -vProses ini kalau dalam bahasa Inggris bisa dipahami seperti ini prosesnya, proses untuk install Node.js. Silakan mencoba dengan menggunakan linux versi WSL atau Linux debian ( ubuntu, kali linux dkk) untuk menocba script bash ini
This script:
Uses
curlto download the Node.js PPA setup script for version 14.x.Pipes the script output to
sudoandbashto execute it with elevated privileges.Installs Node.js and npm using
apt-get.Verifies the installation by printing the versions of Node.js and npm.
To run this script:
Copy and paste the code into a new file with a
.shextension, for exampleinstall-nodejs.sh.Open a terminal and navigate to the directory containing the script file.
Make the script executable using
chmod +x install-nodejs.sh.Run the script using
./install-nodejs.sh.Follow the on-screen prompts to install Node.js and npm.

Social Media