I'm a begginer in NodeJS and when i run node MainApp.js
in console I get this error:
C:\Assigment 2 (NodeJS)\node_modules\mongodb\lib\server.js:235
process.nextTick(function() { throw err; })
^
Error: getaddrinfo ENOTFOUND . .:27017
at errnoException (dns.js:26:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)
I don't know what this means. Inside MainApp I connect mongoose: mongoose.connect("./DataBase");
where DataBase is the folder where I run mongod --dbpath "C:\[...]\DataBase
. The database server seems to start successfully, the console printing: [...] waiting for connections on port 27017
.
server.js lines 231-236:
// Try to callback
try {
callback(err);
} catch(err) {
process.nextTick(function() { throw err; })
}
Package versions: "express": "~4.13.1", "mongodb": "~2.1.0", "mongoose": "~4.3.1"