about node.js [SOLVED]
- saviorhost
- Posts: 47
- Joined: Sun 11. Jan 2026, 13:51
- Location: Turkiye
- Contact:
about node.js
- saviorhost
- Posts: 47
- Joined: Sun 11. Jan 2026, 13:51
- Location: Turkiye
- Contact:
Re: about node.js [SOLVED]
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/