Error: listen EADDRINUSE 0.0.0.0:8080


#1

Hi there!

My workspace: https://ide.c9.io/antalmega/webdevbootcamp

This is my app.js:

var express = require("express");
var app = express();
app.get("/", function(req, res){
    res.render("home.ejs");
});
app.get("/fallinlovewith/:thing", function(req, res){
    var thing = req.params.thing;
    res.render("love.ejs", {thingVar: thing});
});
app.listen(process.env.PORT, process.env.IP, function(){
    console.log("Server is listening!!!");
});

I start the server:

antalmega:~/workspace/MoreExpress/EJSDemo $ node app.js
Server is listening!!!

But I can’t see the preview. If I click Run:

Your code is running at https://webdevbootcamp-antalmega.c9users.io.
Important: use process.env.PORT as the port and process.env.IP as the host in your scripts!
Debugger listening on [::]:15454
events.js:160
      throw er; // Unhandled 'error' event
      ^
Error: listen EADDRINUSE 0.0.0.0:8080
    at Object.exports._errnoException (util.js:1020:11)
    at exports._exceptionWithHostPort (util.js:1043:20)
    at Server._listen2 (net.js:1258:14)
    at listen (net.js:1294:10)
    at net.js:1404:9
    at _combinedTickCallback (internal/process/next_tick.js:83:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)
    at Timeout.Module.runMain [as _onTimeout] (module.js:606:11)
    at ontimeout (timers.js:386:14)
    at tryOnTimeout (timers.js:250:5)
Process exited with code: 1

I tried:

antalmega:~/workspace/MoreExpress/EJSDemo $ killall node
node: no process found
antalmega:~/workspace/MoreExpress/EJSDemo $ 

And restarted my workspace several times with the same result… any idea?


#2

Working now!

I don’t know what was doing wrong. I didn’t changed anything apparently… But I finally can go on!