Perfect! Let’s set up npm on Termux/Linux so you can install global packages without sudo and get real-time script output. This is a clean, “upgraded” setup.
---
Step 1: Create a global npm directory
mkdir ~/.npm-global
This will be the new location for all global npm packages.
---
Step 2: Configure npm to use this directory
npm config set prefix '~/.npm-global'
npm config set foreground-scripts true
prefix → tells npm where to install global packages.
foreground-scripts → ensures scripts run in the foreground so you can see output immediately.
---
Step 3: Add the npm global bin to your PATH
Edit your shell profile (~/.bashrc or ~/.zshrc) and add:
export PATH="$HOME/.npm-global/bin:$PATH"
Then reload your shell:
source ~/.bashrc # or source ~/.zshrc
Check if it worked:
echo $PATH
npm -v
---
Step 4: Test installing a global package
npm install -g nodemon
nodemon -v
Should install without sudo.
Should be executable immediately from any terminal session.
---
✅ Bonus: You now have a fully user-level npm setup. No sudo needed, no permissions errors, and lifecycle scripts run in the foreground.
How to Move, Copy & Delete files in Termux How to Move, Copy & Delete files in Termux How to Move, Copy & Delete files in Termux. Hello friends, in this post I am going to tell you how you can move and copy and delete any file and folder in termux. We saw the basic commands of termux in the previous post. Now we will see the commands that copy, move and delete files. Important things for this 1. Termux Apk: - Download 2. Termux Apk:- Download How to move files and folders in Termux? So let us first see how to move files and folders. we use the move and cut option to move a file to another folder in the file manager. So in that way we use 'mv' command to move a file in termux. With this command, you can move any files, apk, song, movie, folder. So how to use this command. For this, you have to see the steps given b...
Comments
Post a Comment