运行' npm keystone'时出现梯形失真错误安装后

时间:2016-02-09 15:23:15

标签: mongodb mongoose bson keystonejs

我刚刚为个人项目安装了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

2 个答案:

答案 0 :(得分:1)

这是错误消息的重要部分:

Mongo Error: [Error: failed to connect to [localhost:27017]]

Keystone无法连接到您的数据库,您也可以通过在终端中运行以下命令来确认:

mongo localhost:27017

很难说出具体原因,但您应该查看install MongoDB Community Edition on OS X的相关文档。

答案 1 :(得分:0)

昨天和你一样有同样的问题! 为我解决问题是给我所有权利/ data / db :) 我只有阅读的权利。这样做之后,我的服务器启动,网站在localhost上运行。 现在我正在尝试自定义网站。对我来说很难^^