As third-party software, Hosting Marketers does not support node.js beyond installation.
All our servers have node.js installed, but you need to configure it on your account, for that we need to know which port you using for the node, and you will need to create cron job and a bash file. The port we need to open it on our server firewall.

Create a file for example server.js on your account. on this file enter the code:

var http = require(“http”);
http.createServer(function(request, response) {
response.writeHead(200, {“Content-Type”: “text/plain”});
response.write(“Hello World”);
response.end();
}).listen(5002);

the number 5002 is your node port, open a ticket and explain that you going to use node and you want port 5002 opened.

Now in case this is your own vps or a dedicated server:
then create a file for example node.sh and on this file enter the below code:

#!/bin/bash
PGREP=”/usr/bin/pgrep”
NODE=”node”
$PGREP ${NODE}
if [ $? -ne 0 ]
then
/usr/local/bin/node /home/cpanel-username/public_html/server.js> /dev/null 2>&1
fi

we are assuming your first file is server.js.

Now create cron job for the node.sh, this file should be on 755 permissions.
the cron can be:

*/10 * * * * sh /home/cpanel-username/public_html/node.sh >/dev/null 2>&1

this will mean the server will check every 10 minutes if the node is working and restart if it goes down.

this can apply to any script which uses node.js

then to test if the system is working call on your browser:

http://domain:5002
the page should load:
Hello World

But if you are on a shared hosting:
You cannot use the node.sh option because when it pgrep it will find that there is other node process going on so it will not start yours. You will have to contact us so that we use the SCREEN option which will leave the process running on background even when we close the cmd window.
so we open cmd and type
screen
/usr/local/bin/node /home/cpanel-username/public_html/server.js
CTRL D + A
this will close the window and the process will continue, to test
http://domain:5002
the page should load:
Hello World