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 -ypkg install nodejs -yCheck Node.js version:
node --versionCheck npm version:
npm --versionCreate a JS file:
nano app.jsAdd this code:
console.log("Hello Termux!");Run the file:
node app.jsBasic Commands
Run any JavaScript file:
node filename.jsInstall a package using npm:
npm install package-nameList installed packages:
npm listInitialize a new project:
npm init -yUninstall Node.js:
pkg uninstall nodejs