0
我完成了,當我試圖與後續的命令來訪問它解析即成NPM安裝如下解析,服務器NPM安裝 - 內部服務器錯誤
$ npm install -g parse-server mongodb-runner
$ mongodb-runner start
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY
.....
$ curl -X POST -H "X-Parse-Application-Id: AppID123" -H "Content-Type: application/json" -d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' http://localhost:1337/parse/classes/GameScore
我得到了以下錯誤:
{"code":1,"message":"Internal server error."}
以下是運行解析服務器的結果....
$ parse-server --appId AppID123 --masterKey Master123
appId: AppID8Rasp
masterKey: ***REDACTED***
port: 1337
mountPath: /parse
maxUploadSize: 20mb
serverURL: http://localhost:1337/parse
parse-server running on http://localhost:1337/parse
warn: Unable to ensure uniqueness for usernames: MongoError: failed to connect to server [localhost:27017] on first connect
at null.<anonymous> (/usr/local/lib/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:311:35)
at emitOne (events.js:77:13)
at emit (events.js:169:7)
at null.<anonymous> (/usr/local/lib/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:254:12)
at g (events.js:260:16)
at emitTwo (events.js:87:13)
at emit (events.js:172:7)
at Socket.<anonymous> (/usr/local/lib/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/connection/connection.js:158:49)
at Socket.g (events.js:260:16)
at emitOne (events.js:77:13)
warn: Unable to ensure uniqueness for user email addresses: MongoError: failed to connect to server [localhost:27017] on first connect
at null.<anonymous> (/usr/local/lib/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:311:35)
at emitOne (events.js:77:13)
at emit (events.js:169:7)
at null.<anonymous> (/usr/local/lib/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:254:12)
at g (events.js:260:16)
at emitTwo (events.js:87:13)
at emit (events.js:172:7)
at Socket.<anonymous> (/usr/local/lib/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/connection/connection.js:158:49)
at Socket.g (events.js:260:16)
at emitOne (events.js:77:13)
error: Error generating response. { [MongoError: failed to connect to server [localhost:27017] on first connect]
name: 'MongoError',
message: 'failed to connect to server [localhost:27017] on first connect' } name=MongoError, message=failed to connect to server [localhost:27017] on first connect
error: Uncaught internal server error. { [MongoError: failed to connect to server [localhost:27017] on first connect]
name: 'MongoError',
message: 'failed to connect to server [localhost:27017] on first connect' } MongoError: failed to connect to server [localhost:27017] on first connect
at null.<anonymous> (/usr/local/lib/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:311:35)
at emitOne (events.js:77:13)
at emit (events.js:169:7)
at null.<anonymous> (/usr/local/lib/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:254:12)
at g (events.js:260:16)
at emitTwo (events.js:87:13)
at emit (events.js:172:7)
at Socket.<anonymous> (/usr/local/lib/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/connection/connection.js:158:49)
at Socket.g (events.js:260:16)
at emitOne (events.js:77:13)
MongoError: failed to connect to server [localhost:27017] on first connect
at null.<anonymous> (/usr/local/lib/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:311:35)
at emitOne (events.js:77:13)
at emit (events.js:169:7)
at null.<anonymous> (/usr/local/lib/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:254:12)
at g (events.js:260:16)
at emitTwo (events.js:87:13)
at emit (events.js:172:7)
at Socket.<anonymous> (/usr/local/lib/node_modules/parse-server/node_modules/mongodb/node_modules/mongodb-core/lib/connection/connection.js:158:49)
at Socket.g (events.js:260:16)
at emitOne (events.js:77:13)
當然可以使用一些指針!謝謝。
的錯誤說,它不能連接到數據庫,因此驗證數據庫正在運行。 –
我很抱歉這麼厚,但我該怎麼做? – hypermiler
試過; sudo服務分析服務器狀態。說它沒有運行。如果它沒有運行,那麼jeeez,怎麼了? parse-server命令似乎正在工作..... – hypermiler