Your EADDRINUSE nightmares can come to an end.
Look for processes currently listening in the provided port, process.kill all of them, and then invoke the callback function, which will be safely able to listen on that port.
npm install dictatorship --save
var dictatorship = require('dictatorship');
dictatorship.overthrow(port, function(){
app.listen(port); // no EADDRINUSE non-sense
});Not recommended for production environments. The purpose of this module is to overthrow renegade node processes spawned by grunt-contrib-watch and their ilk.