【发布时间】:2016-05-19 15:42:04
【问题描述】:
我刚刚为个人项目安装了 keystone 并学习它。安装后我只运行命令node keystone 但此错误显示:
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
------------------------------------------------
Mongo Error:
[Error: failed to connect to [localhost:27017]]
/Users/msantamaria/Documents/dev/presonal_projects/test-keystone/node_modules/keystone/lib/core/mount.js:616
throw new Error('KeystoneJS (' + keystone.get('name') + ') failed to start');
^
Error: KeystoneJS (test-keystone) failed to start
at NativeConnection.<anonymous> (/Users/msantamaria/Documents/dev/presonal_projects/test-keystone/node_modules/keystone/lib/core/mount.js:616:10)
at emitOne (events.js:77:13)
at NativeConnection.emit (events.js:169:7)
at NativeConnection.Connection.error (/Users/msantamaria/Documents/dev/presonal_projects/test-keystone/node_modules/mongoose/lib/connection.js:389:8)
at /Users/msantamaria/Documents/dev/presonal_projects/test-keystone/node_modules/mongoose/lib/connection.js:416:14
at /Users/msantamaria/Documents/dev/presonal_projects/test-keystone/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js:57:21
at /Users/msantamaria/Documents/dev/presonal_projects/test-keystone/node_modules/mongodb/lib/mongodb/db.js:286:18
at /Users/msantamaria/Documents/dev/presonal_projects/test-keystone/node_modules/mongodb/lib/mongodb/db.js:365:7
at doNTCallback0 (node.js:428:9)
at process._tickCallback (node.js:357:13)
我已经阅读了很多,但我找不到解决此问题的方法,许多人建议更改节点版本,其他人删除 node_modules 并再次执行npm install 将修复它,但没有运气。
提前致谢,这是我的规格:
OS: Mac OSX 10.10.5
node: v5.0.0
npm: v3.3.6
Python: 2.7.10
Mongo: 3.2.1
【问题讨论】:
-
它无法连接到您的 MongoDB 实例。在终端中运行
mongo localhost:27017会发生什么? -
@Pier-LucGendreau 这就是我运行
mongo localhost:27017MongoDB shell version: 3.2.1connecting to: localhost:27017/test2016-02-09T11:29:29.027-0500 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused2016-02-09T11:29:29.028-0500 E QUERY [thread1] Error: couldn't connect to server localhost:27017, connection attempt failed :connect@src/mongo/shell/mongo.js:226:14 @(connect):1:6exception: connect failed时会发生的情况。谢谢。
标签: mongodb mongoose bson keystonejs