vladzam
vladzam

Reputation: 5908

Sails.js server not starting anymore

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!

Upvotes: 3

Views: 6708

Answers (3)

user3431805
user3431805

Reputation: 121

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

Upvotes: 11

Kirk Sefchik
Kirk Sefchik

Reputation: 813

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.

Upvotes: 0

mikermcneil
mikermcneil

Reputation: 11271

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.

Upvotes: 0

Related Questions