2015-11-01 93 views
2

時,當我在終端上運行的節點server.js,我收到以下錯誤從貓鼬:貓鼬錯誤運行節點

/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 
    at Object.exports._errnoException (util.js:860:11) 
    at exports._exceptionWithHostPort (util.js:883:20) 
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1063:14) 

我已經跑了NPM帶有警告安裝貓鼬,但我懷疑這就是原因mongodb數據庫沒有運行。下面是警告:

> [email protected] 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' is 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 
+1

這意味着它不能在127.0.0.1(本地主機)端口27017連接到您的MongoDB服務器,可能是它的下跌。 –

+0

謝謝。我沒有意識到mongodb服務器沒有啓動 – user3061676

回答

2

當MongoDB的服務是不是在你的machine.So運行下面的命令,它會幫助你打開沒有中斷,節點服務器啓動它可以發生,以及MongoDB也將運行在默認端口上。

BREW服務啓動MongoDB的