Search code examples
angularjsnode.jsserverupstart

Trouble using upstart to run simple node server


I'm trying to run a simple node js server on digital ocean using this tutorial which I have successfully done before. When I run node server.js my project loads on the ip perfectly, but after following the directions and using upstart, and running

start node-server I get

node-server start/running, process 3265 but then nothing shows up at the ip address, and i get a net::ERR_CONNECTION_REFUSED in the console. What could I be doing wrong this time around?

I'm using a cross-origin $.get("http://www.w3schools.com/angular/customers_mysql.php"). Could that be an issue?

When I initctl status node-server I get node-server stop/waiting

When I cd into /usr/local/bin I see nothing and /usr/local/bin/node: not found is in the logs. In a working implementation I have a npm and node in the bin directory, but for some reason there isn't one in this project. How do I create it?


Solution

  • I ended up getting it work by copying the node and npm files from one droplet to another:

    scp -r /usr/local/bin/. [email protected]:/usr/local/bin

    Now i know that's pretty ghetto and probably not the right way, so i'm still holding out for the right answer. Thank you.