about node.js  [SOLVED]

General discussions around KeyHelp.
Post Reply
User avatar
saviorhost
Posts: 47
Joined: Sun 11. Jan 2026, 13:51
Location: Turkiye
Contact:

about node.js

Post by saviorhost »

Hello; I have no idea about Node.js. My clients are asking about Node.js. I want to offer them this service. Is there any documentation or help available regarding this? Thank you in advance.
User avatar
saviorhost
Posts: 47
Joined: Sun 11. Jan 2026, 13:51
Location: Turkiye
Contact:

Re: about node.js  [SOLVED]

Post by saviorhost »

I think I've solved it. If there are any missing parts or security vulnerabilities, I would appreciate your help.

In the Restricted SSH Environment, I added the following to the files section under Additional Binaries:

Then, after granting SSH permission, I wrote the following:

1. I installed a custom Node.js engine with NVM.

export NVM_DIR="/www/.nvm"

[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

nvm install 20

nvm use 20

2. Completely Overcoming NPM EACCES (Authorization) Errors

export HOME="/www"
npm install --legacy-peer-deps

3. PM2 Installation in a Jailed Environment and Solving the "module_conf.json" Error

export PM2_HOME="/www/.pm2"
npm install -g pm2
pm2 status

4. Starting the Application and Making PM2 Persistent

cd /www/
pm2 start index.js --name "project-name" --cwd /www/
pm2 save

Bonus: Preserving Settings Every Time SSH is Opened (.bashrc Automation)

echo 'alias start="export HOME=/www && export PM2_HOME=/www/.pm2 && export NVM_DIR=/www/.nvm && [ -s \"\$NVM_DIR/nvm.sh\" ] && . \"\$NVM_DIR/nvm.sh\" && nvm use 20"' >> /www/.bashrc
source /www/.bashrc

Now, every time you connect to SSH, you only need to type start and press Enter. All your NVM and PM2 paths will be ready in the background within seconds.

detail link : https://saviorhost.com/blog/kisitli-jai ... m-rehberi/
Post Reply