The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Jumy Elerossë (11) [Avatar] Offline
#1
I'm struggling to connect to MongoDB using mongoose. The matter is that, if I use mongoose 5, I have problems with geonear. But If I use mongoose 4.9.1, I can connect to Mongo using Linux but not using OS X. When I try to use mongoose 4.9.1 in OS X, I always have the same error:

Mongoose disconnected
Mongoose connection error: { MongoError: failed to connect to server [undefined:27017] on first connect [MongoError: getaddrinfo ENOTFOUND undefined undefined:27017]


Any suggestion?

EDIT: It seems like in OS X the Node environment is set as production by default (NODE_ENV === 'production'), and therefore taking the wrong settings... I just need to start nodemon as:
NODE_ENV=development nodemon