KeystoneJs应用程序在服务器启动"节点KeystoneJs "失败

KeystoneJs application is failing on server start - "node keystonejs"

本文关键字:quot KeystoneJs 节点 失败 启动 应用程序 服务器      更新时间:2023-09-26

我是keystonejs的新手,并试图在keystonejs中创建第一个hello world应用程序。我安装了所有依赖于我的本地(nodejs和mongoDB)。我已经启动了我的mongoDB服务器。

但是当我试图用"节点keystonejs"启动keystonejs时,得到以下错误。请建议可能是什么问题。非常感谢。

------------------------------------------------
Mongo Error:
[Error: connection closed]
D:'Neha Masters'3D internship'CMS-Keystone-project'node_modules'keystone'lib'cor
e'mount.js:587
                        throw new Error('KeystoneJS (' + keystone.get('name') +
') failed to start'
                              ^
Error: KeystoneJS (helloworld) failed to start
    at NativeConnection.<anonymous> (D:'Neha Masters'3D internship'CMS-Keystone-
project'node_modules'keystone'lib'core'mount.js:587:10)
    at NativeConnection.emit (events.js:107:17)
    at NativeConnection.Connection.error (D:'Neha Masters'3D internship'CMS-Keys
tone-project'node_modules'keystone'node_modules'mongoose'lib'connection.js:389:8
)
    at D:'Neha Masters'3D internship'CMS-Keystone-project'node_modules'keystone'
node_modules'mongoose'lib'connection.js:416:14
    at D:'Neha Masters'3D internship'CMS-Keystone-project'node_modules'keystone'
node_modules'mongoose'lib'drivers'node-mongodb-native'connection.js:57:21
    at D:'Neha Masters'3D internship'CMS-Keystone-project'node_modules'keystone'
node_modules'mongoose'node_modules'mongodb'lib'mongodb'db.js:286:18
    at D:'Neha Masters'3D internship'CMS-Keystone-project'node_modules'keystone'
node_modules'mongoose'node_modules'mongodb'lib'mongodb'db.js:365:7
    at process._tickCallback (node.js:355:11)

在mongoDB控制台,我可以看到以下错误-

2015-08-26T14:37:59.425-0700 I CONTROL  [conn1] mongod.exe    ...'src'mongo'util
'net'message_server_port.cpp(232)              mongo::PortMessageServer::handleI
ncomingMsg+0x573
2015-08-26T14:37:59.426-0700 I CONTROL  [conn1] mongod.exe    ...'src'third_part
y'boost'libs'thread'src'win32'thread.cpp(185)  boost::`anonymous namespace'::thr
ead_start_function+0x21
2015-08-26T14:37:59.426-0700 I CONTROL  [conn1] MSVCR120.dll
                                               beginthreadex+0x107
2015-08-26T14:37:59.426-0700 I CONTROL  [conn1] MSVCR120.dll
                                               endthreadex+0x192
2015-08-26T14:37:59.427-0700 I CONTROL  [conn1] kernel32.dll
                                               BaseThreadInitThunk+0xd
2015-08-26T14:37:59.428-0700 I CONTROL  [conn1]
2015-08-26T14:37:59.429-0700 I NETWORK  [conn1] AssertionException handling requ
est, closing client connection: 10307 Client Error: bad object in message: bson
length doesn't match what we found in object with unknown _id
2015-08-26T14:37:59.435-0700 I NETWORK  [conn2] end connection 127.0.0.1:54577 (
3 connections now open)
2015-08-26T14:37:59.435-0700 I NETWORK  [conn3] end connection 127.0.0.1:54578 (
3 connections now open)
2015-08-26T14:37:59.436-0700 I NETWORK  [conn4] end connection 127.0.0.1:54579 (
3 connections now open)
2015-08-26T14:37:59.436-0700 I NETWORK  [conn5] end connection 127.0.0.1:54580 (
2 connections now open)

你开始mongod了吗?

我总是跑

mongod
然后

mongo db

then start keystone with nodemon

nodemon keystone

也就是说,你的keystone错误是数据库连接不正确的特征。