Install nodejs on shared server

牧云@^-^@ 提交于 2021-02-18 08:04:56

问题


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


回答1:


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




回答2:


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!




回答3:


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.




回答4:


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.



来源:https://stackoverflow.com/questions/33322946/install-nodejs-on-shared-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!