我有一个只包含两行的文件database.coffee
mongoose = require('mongoose')
mongoose.connect 'mongodb://localhost:27017/myDatabase'
运行coffee database.coffee
时,我得到以下输出:
/SOMEPATH/node_modules/mongodb/lib/server.js:236
process.nextTick(function() { throw err; })
^
Error: connect ECONNREFUSED
at errnoException (net.js:901:11)
at Object.afterConnect [as oncomplete] (net.js:892:19)
可能导致此错误的原因是什么?