3

I am using Cloud 9 IDE to develop a simple CRUD application using Sails.js (node.js MVC framework). Up until today I had no trouble starting the Sails.js server.

Today, I've been trying to start the sails js server, but I keep getting this error:

warn: error raised: Error: listen EACCES                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
error: Server doesn't seem to be starting.                                                                                                                                                                                                                                       
error: Perhaps something else is already running on port 8080?

I have checked my /config/local.js file and everything is just fine, as it should be. The port is set to process.env.PORT || 1337 so it shouldn't have any problems firing the server up.

I'm looking forward to your insight.

Thank you!

vladzam
  • 5,462
  • 6
  • 30
  • 36
  • Hi! You know anything new from this? Thank you! – Imaky Jan 19 '14 at 01:16
  • Hello! As far as I remember, I believe there was an issue with how C9 handled the node deployment. I recall that, back in August, I stopped using C9 for about 3 weeks, and when I got back to give it a try it simply worked. Unfortunately, I can't say that I found a certain bug or issues with C9. It was just an unlucky, random situation :) – vladzam Jan 20 '14 at 07:51

3 Answers3

11

Open terminal and run this command:

$ lsof -i :8080 

Output will show PID of process occupying port 8080: "httpd 1234 ....' Then kill the process with this command

$ kill -9 1234

Sails will now run

user3431805
  • 111
  • 1
  • 4
0

Hmm-- looks like port 8080 isn't available. What happens if you try to switch the port? You may have another server running on that port. Or in some cases, hosts require the hostname to be set. I'd try switching the port first though.

mikermcneil
  • 11,141
  • 5
  • 43
  • 70
  • 1
    I've tried switching the port, but the C9 platform fires the sails js application on port 8080 no matter what changes I try to do. P.S.: Thanks a lot for this awesome framework that you have developed! I find it to be a great tool for modern web development. Keep up the good work! – vladzam Aug 17 '13 at 21:44
  • No problem :) Hm- might be worth a google to see if there's anything else that runs on that port you'd have to disable? Also, you might have to explicitly set the hostname (I've seen this before when sails/express is running behind a proxy server) – mikermcneil Aug 17 '13 at 22:08
  • Nothing runs on that port. I've searched for that before asking here. I've also tried starting a new project and making a fresh install of sails, but I still have the same issue. – vladzam Aug 17 '13 at 22:22
  • I am facing same issue even after supplying Host and Port. Please check this out http://stackoverflow.com/questions/19375581/deploy-sails-js-on-openshift-app-restarting-over-and-over – Durgesh Oct 17 '13 at 18:16
0

The only real answer to this is: wait. C9 seems to kill servers in a weird way that causes Sails to jack up and blocks you from establishing another server. lsof -i doesn't show anything serving... but it still won't start. Seems to be an issue with Cloud 9 and Sails.js. If I serve a generic Node.js "Hello World" app on the same port, the issue doesn't occur. However, time, it seems, cures all. After awhile, Sails seems to snap out of it and starts serving again when lifted.

Incredibly weird.

Kirk Sefchik
  • 673
  • 1
  • 9
  • 22
  • But wait! There's more! I just logged in C9 and created a new workspace; when I'm trying to install sails using npm, it fails to do so. I get and error starting with npm ERR! Error cannot find module 'readable-stream'. (I would've posted the whole error log here, but there's not enough space) – vladzam Aug 19 '13 at 06:26
  • I'm having the same problem. I can't install anything using NPM on C9 anymore. Going to submit a ticket for that as well. :/ – Kirk Sefchik Aug 19 '13 at 07:33