【发布时间】:2014-03-06 13:22:30
【问题描述】:
这里是一个总节点菜鸟。我一直在尝试设置示例节点应用程序,但每次尝试运行时都会弹出以下错误:
节点应用
Failed to load c++ bson extension, using pure JS version
events.js:72
throw er; // Unhandled 'error' event
^
Error: failed to connect to [#$%67890 :27017]
at null.<anonymous> (/home/thejazeto/code/nodejs/authen/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:553:74)
at EventEmitter.emit (events.js:106:17)
at null.<anonymous> (/home/thejazeto/code/nodejs/authen/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:140:15)
at EventEmitter.emit (events.js:98:17)
at Socket.<anonymous> (/home/thejazeto/code/nodejs/authen/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:512:10)
at Socket.EventEmitter.emit (events.js:95:17)
at net.js:830:16
at process._tickCallback (node.js:415:13)
【问题讨论】:
-
错误是
failed to connect to,所以我认为bson消息可能无关,实际上并不重要。你确定你的 Mongo 连接设置正确吗? -
有趣的故事我只在 Windows 机器上收到此错误...尚未尝试安装 node-gyp 但我尝试了几乎所有其他方法但仍然收到错误。并且 chocoletey 不会安装构建要素
-
现在的 JS BSON 代码不是几乎和 C++ 一样快了吗?如果是这样,这真的是个问题吗?
-
对于新 iojs 上遇到此问题的人,我已开票跟踪此问题:github.com/mongodb/js-bson/issues/136
-
注意:我使用 Keystone.js 作为我的 mvc 框架。对我来说,您将“../build/Release/bson”更改为“../browser_build/bson”。如果你上去,你会看到 browser_build 文件夹。
标签: javascript node.js express mongoose dependencies