$ node app.js Express server listening on port 3000
events.js:71 throw arguments[1]; // Unhandled ‘error’ event ^ Error: failed to connect to [127.0.0.1:27017] at Server.connect.connectionPool.on.server._serverState (D:\workspace\Node\todo\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\server.js:482:73) at EventEmitter.emit (events.js:126:20) at connection.on._self._poolState (D:\workspace\Node\todo\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\connection_pool.js:96:15) at EventEmitter.emit (events.js:99:17) at Socket.errorHandler (D:\workspace\Node\todo\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\connection.js:411:10) at Socket.EventEmitter.emit (events.js:96:17) at Socket._destroy.self.errorEmitted (net.js:328:14) at process.startup.processNextTick.process._tickCallback (node.js:244:9)
本机木有启动MongoDB服务器吧?!
哈哈 对了 百度了好久才安上MongoDB。我是个初学者,以前一直学java的 刚接触node 和以前学的有很大差别 以后还请多多赐教啊