All     Ethical Hacking     Networking     Programming     OSINT

Node.js in Termux – Installation & Basic Commands

Node.js allows you to run JavaScript outside the browser, making it great for backend scripts, bots, tools, and automation. With Termux, you can install Node.js easily on your Android phone and start running JavaScript programs within minutes. Below are the installation steps and basic commands.

Installation

pkg update && pkg upgrade -y
pkg install nodejs -y

Check Node.js version:

node --version

Check npm version:

npm --version

Create a JS file:

nano app.js

Add this code:

console.log("Hello Termux!");

Run the file:

node app.js

Basic Commands

Run any JavaScript file:

node filename.js

Install a package using npm:

npm install package-name

List installed packages:

npm list

Initialize a new project:

npm init -y

Uninstall Node.js:

pkg uninstall nodejs