Jump to content

node.js


Arbu

Recommended Posts

You say that "Node.js uses JavaScript on the server". But your tutorial relates to setting up my own computer as a server and running node on that. I need to use the server from my hosting company. When I try to use node on my website I fall at the first hurdle. I get the error: "Uncaught ReferenceError: require is not defined". How do I ensure that node is running on my hosting provider?

Link to comment
Share on other sites

  • 2 months later...

Who's your provider? If it's a shared hosting provider like Hostgator or the like, chances are it's running Apache/cPanel. In which case, they won't let you. If you want to use a service provider and not your own computer, you'll need a provider like Google Cloud, Amazon AWS, Linode, Digital Ocean, etc. Somebody who will let you run Virtual Machines or instances of operating systems where you would then remote in or use their web interface to install node and any dependencies.

The alternative is to self-host. That's easy to do if you can afford to leave a computer running (for production/live websites). To get around the lack of static IP addresses, use a 3rd party service like NoIP.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...