Issues with installing nodeJS on a shared hosting plan

1k views Asked by At

Here are the steps I am following:

First, I login to my account using SSH.

Then, I install nvm using

wget -qO- https://cdn.rawgit.com/creationix/nvm/master/install.sh | bash

Then, I restart the shell

Then, I install node using

nvm install stable

enter image description here

But, when I check for the version of the node using the following, it says 'command not found'

node --version

If it helps, here are other things I tried:

nvm list

enter image description here

Also, here are the contents of the .nvm folder (which is inside the root folder):

enter image description here

I suppose N/A indicates that node is not available.

To sum it up, is it possible at all to use node.js on a shared hosting plan? If, yes, what can I do to make it work?

PS: I have been getting suggestions to use other plans like Heroku etc. Although, I have already invested a lot in this shared hosting plan (on GoDaddy), so I would really like if I can host nodeJS applications here.

PPS: I am new to programming, so please bear with any ignorance.

2

There are 2 answers

0
Alex On

Try installing node like this

nvm install node

Then, crucially

nvm alias default node

Now running

node -v

Should display correctly

0
Saurin Dashadia On

First of all shared server wont allow you to install anything on their server.

If you can able to install node on your shared server then you are pretty lucky.

To run node --version command, the node command should be in your path. On shared server, it might not be allowed.

So I think you need to check with full path like `/usr/bin/node --version' (check your installation path)