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.
Setting up a free SMTP server for sending emails typically involves using an email service that offers free SMTP access. Here's a general guide on how to set up SMTP for free: 1. **Choose a Free Email Service**: There are several email providers that offer free SMTP servers, including Gmail, Yahoo Mail, and Outlook.com. Choose the one that suits your needs. 2. **Create an Email Account**: If you don't already have an email account with the chosen provider, sign up and create one. Make sure to remember your email address and password. 3. **Enable SMTP Access**: Some email providers may require you to enable SMTP access for your account. This is often found in your account settings or security settings. Enable SMTP access if required. 4. **Obtain SMTP Server Details**: Your email provider will have specific SMTP server details you need to use. These typically include: - SMTP Server Address (e.g., smtp.gmail.com for Gmail) - SMTP Port (e.g., 587 for STARTTLS or 465 for SSL/T...
Comments
Post a Comment