ExpressJS – throw er Unhandled error event-Collection of common programming errors

If you’ve tried killing all node instances and other services listening on 3000 (the default used by the express skeleton setup) to no avail, you should check to make sure that your environment is not defining ‘port’ to be something unexpected. Otherwise, you’ll likely get the same error. In the express skeleton’s app.js file you’ll notice line 15:

app.set('port', process.env.PORT || 3000);