3

I have one shared server acoount. Searched more time "how to install nodejs on shared server" but i can't find any thing. Just this link

but not working

Community
  • 1
  • 1
officialmmt
  • 65
  • 1
  • 2
  • 12

4 Answers4

6

Login on SSH and type this code:

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

Now close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

nvm install node
nvm use node

For more informations, check my website: Add Nodejs on HostGator Shared Hosting Server

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
DZeta
  • 61
  • 1
  • 3
  • if the given command doesn't work for you, try using below command (using curl) `curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash` and then just restart your ssh terminal. – Jaydip Kalkani Aug 16 '20 at 14:20
4

I am not sure if you are still looking for the answer but here's what I did that helped me. In your local system, first go to your react project. Open the package.json file and add a line

 "homepage" : "http://www.yourwebsite.com"

after the scripts. Run

"npm run build" 

and upload all the files to your hostgator shared server. Hope this helps.

happymacarts
  • 2,547
  • 1
  • 25
  • 33
Umesh_Shah
  • 49
  • 4
  • I have problem with. I tryed work on total js cms project and i can't run it. Nothing will show with htaccess and node debug.js. [Here the my new discussion](https://stackoverflow.com/questions/52343573/how-to-deploy-totaljs-app-with-apache-shared-hosting) – officialmmt Sep 19 '18 at 10:19
3

You may want to check out CGI-Node. Here they have explained about running it on GoDaddy!

Didn't want to mark your answer duplicate, as you have yourself linked that question, but please avoid posting duplicate questions!

user2473779
  • 711
  • 6
  • 18
0

If you don't have access to install node.js (some shared services have blocked the ability to run unix scripts .sh files), you may try with php exec("") command, running afterwards the unix shell php command with php -f file.php. Check here.

Community
  • 1
  • 1
João Pimentel Ferreira
  • 14,289
  • 10
  • 80
  • 109