Hi,
I have just installed node.js on my shared server. Seems to be working since I get past the 2 tests. However, I cant get to run socket.io after following this tutorial.
support.cpanel.net
1. I created the directory which is the same one where I put my app.js file (the one you use to test node,js)
2. I put the package.json file
3. I installed the packaged express and socket.io which created a directory called node_modules inside the directory where I put app.js.
4. I modified the app.js file according to the instructions from the tutorial but now the node.js tests wont work. Instead of getting the Hello World! NodeJS test message it says it cant find the directory.
5. I created the index file but on the console it says io() is not defined. This seems to be because the path of socket.io.js is wrong and I had to point it to node_modules/socket.io/client-dist since thats where the .js file was created when I installed the module.
6. I deployed the application on cpanel.
Now I get no error on the console but the test chat simply wont work regardless. I guess because of error on step 4 but even with the original app.js I cant get it to work.
Please notice that when I point my browser to mydpmain.com/testchat I get the node.js test message whereas i I point it to mydpmain.com/testchat/ (add the last slash) then I get the test chat page.
All this is very confusing to me and I would appreciate if you put me in the right direction.
Thank you.
I have just installed node.js on my shared server. Seems to be working since I get past the 2 tests. However, I cant get to run socket.io after following this tutorial.

Getting Started with Socket.IO and NodeJS 10 on cPanel
Introduction Please keep in mind the installation, configuration, and management of Socket.IO is best handled by a developer or systems administrator with the skills, training, and expertise requ...
1. I created the directory which is the same one where I put my app.js file (the one you use to test node,js)
2. I put the package.json file
3. I installed the packaged express and socket.io which created a directory called node_modules inside the directory where I put app.js.
4. I modified the app.js file according to the instructions from the tutorial but now the node.js tests wont work. Instead of getting the Hello World! NodeJS test message it says it cant find the directory.
5. I created the index file but on the console it says io() is not defined. This seems to be because the path of socket.io.js is wrong and I had to point it to node_modules/socket.io/client-dist since thats where the .js file was created when I installed the module.
6. I deployed the application on cpanel.
Now I get no error on the console but the test chat simply wont work regardless. I guess because of error on step 4 but even with the original app.js I cant get it to work.
Please notice that when I point my browser to mydpmain.com/testchat I get the node.js test message whereas i I point it to mydpmain.com/testchat/ (add the last slash) then I get the test chat page.
All this is very confusing to me and I would appreciate if you put me in the right direction.
Thank you.
Last edited by a moderator: