Friday, 26 May 2017

Node server Error EADDRINUSE when no ports are in use?

I am trying to start a simple localhost node server on OSx, but keep getting the error:

Error: listen EADDRINUSE :::3000

This also happens with port 8080, 8888 -- it doesn't matter what port I choose.

The solution I see everywhere is to identify the process id for running instances and use kill -9 <pid> but it doesn't look like anything is running. I have tried looking at netstat, lsof -i:[port], ps ax | grep node, etc. but nothing shows up.

The simple server looks like:

var express = require('express');
var app = express();

var server = app.listen(3000, '0.0.0.0', function() {
  console.log("Listening on: http://localhost:3000");
});

app.get("/", function(req, res) {
    res.send("Online")
})



via alphaleonis

No comments:

Post a Comment