I have that code:
var express = require(\'express\'),
stylus = require(\'stylus\'),
logger = require(\'morgan\'),
bodyParser = require(\'body-par
I was having the same problem, and found that it was a mongod issue.(I am running Ubuntu 16.04). Looking through the errors there was a directory missing. After adding the directory, I needed to change permissions, and finally, set the mongod service to start at boot.
$ sudo mkdir -p /data/db
$ sudo chown -R $USER /data/db
$ sudo systemctl enable mongod.service