express - Mongoose error when running node -
when run node server.js in terminal, receive following error mongoose:
/users/xxxx/desktop/projects/crud/node_modules/mongoose/node_modules/mongodb/lib/server.js:235 process.nexttick(function() { throw err; }) ^ error: connect econnrefused 127.0.0.1:27017 @ object.exports._errnoexception (util.js:860:11) @ exports._exceptionwithhostport (util.js:883:20) @ tcpconnectwrap.afterconnect [as oncomplete] (net.js:1063:14)
i've ran npm install mongoose warning, doubt that's reason mongodb database isn't running. here warning:
> kerberos@0.0.17 install /users/sean/desktop/projects/crud/node_modules/kerberos > (node-gyp rebuild) || (exit 0) cxx(target) release/obj.target/kerberos/lib/kerberos.o cxx(target) release/obj.target/kerberos/lib/worker.o cc(target) release/obj.target/kerberos/lib/kerberosgss.o ../lib/kerberosgss.c:509:13: warning: implicit declaration of function 'gss_acquire_cred_impersonate_name' invalid in c99 [-wimplicit-function-declaration] maj_stat = gss_acquire_cred_impersonate_name(&min_stat, ^ 1 warning generated. cc(target) release/obj.target/kerberos/lib/base64.o cxx(target) release/obj.target/kerberos/lib/kerberos_context.o solink_module(target) release/kerberos.node
it can happen when mongodb service not running on machine.so start below command open node server no interrupt mongodb run on default port.
brew services start mongodb
Comments
Post a Comment