I have that code:
var express = require(\'express\'),
stylus = require(\'stylus\'),
logger = require(\'morgan\'),
bodyParser = require(\'body-par
I was also facing the same issue, when I was executing node server
on my project directory. For me the MongoDB service was not started, that makes this issue.
So I had to run services.msc
and activated the service.
After that I was able to run my command.
D:\SVenu\MyApp>node server
Saving User
App is listening on port: 3000
Already Exist
Already Exist
Already Exist
Already Exist
Done save
I know this issue is old, but i came across a similar issue and the above solutions did not work for me, I'm using Ubuntu 20.04 LTS.
What i did to make it work was just running mongo service using this command:
$ mongod
Then everything worked fine