Express works without app.listen or servers

I have carefully examined my app.js file in the project root directory, but I cannot find app.listen or the server object that gets running for npm start. Everything works fine except that, but I need the server object in order to use socket.io. I've tried setting it up manually but it ends up with an error saying that the port (3000) is in use. Can you specify which line or method contains app.listen? This template was generated using express-generator and I have made only a few modifications.

var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var routes = require('./routes/index');
var users = require('./routes/users');

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

// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');

// uncomment after placing your favicon in /public
//app.use(favicon(__dirname + '/public/favicon.ico'));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

app.use('/', routes);
app.use('/users', users);

// catch 404 and forward to error handler
app.use(function (req, res, next) {
    var err = new Error('Not Found');
    err.status = 404;
    next(err);
});

// error handlers

// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
    app.use(function (err, req, res, next) {
        res.status(err.status || 500);
        res.render('error', {
            message: err.message,
            error: err
        });
    });
}

// production error handler
// no stacktraces leaked to user
app.use(function (err, req, res, next) {
    res.status(err.status || 500);
    res.render('error', {
        message: err.message,
        error: {}
    });
});

module.exports = app;

Below is the error log

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: listen EADDRINUSE
    at errnoException (net.js:904:11)
    at Server._listen2 (net.js:1042:14)
    at listen (net.js:1064:10)
    at Server.listen (net.js:1138:5)
    at Function.app.listen (/Users/Lee/Desktop/bwall/node_modules/express/lib/application.js:556:24)
    at Object.<anonymous> (/Users/Lee/Desktop/bwall/bin/www:7:18)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)

Your error is saying that you're already using port 3000 on your computer, so you can't run this server. What you should do is look for other processes running, and kill them, then re-try.

For instance, if you're on Mac, you open the activity monitor, look for node apps, and kill them.

This will fix your issue!

UPDATE: Look at your package.json if you want to see what the npm start script is doing.