尝试将MERN堆栈应用程序部署到heroku时收到应用程序错误

时间:2019-12-09 14:05:37

标签: reactjs mongodb heroku mern

这是我完整的日志。谁能告诉我这是怎么回事?构建成功后,为什么不能打开应用程序?我已经坚持了将近一天。

2019-12-09T13:41:57.000000+00:00 app[api]: Build succeeded
2019-12-09T13:42:05.327952+00:00 heroku[web.1]: Starting process with command `npm start`
2019-12-09T13:42:07.318317+00:00 app[web.1]:
2019-12-09T13:42:07.318360+00:00 app[web.1]: > mern-stack@1.0.0 start /app
2019-12-09T13:42:07.318364+00:00 app[web.1]: > node server.js
2019-12-09T13:42:07.318366+00:00 app[web.1]:
2019-12-09T13:42:07.855047+00:00 app[web.1]: (node:23) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and 
will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
2019-12-09T13:42:07.856472+00:00 app[web.1]: Server is running on Port: 4000
2019-12-09T13:42:07.870198+00:00 app[web.1]: (node:23) UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [127.0.0.1:27017] on first connect [Error: connect ECONNREFUSED 127.0.0.1:27017
2019-12-09T13:42:07.870203+00:00 app[web.1]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1129:14) {
2019-12-09T13:42:07.870205+00:00 app[web.1]: name: 'MongoNetworkError',
2019-12-09T13:42:07.870208+00:00 app[web.1]: [Symbol(mongoErrorContextSymbol)]: {}
2019-12-09T13:42:07.870210+00:00 app[web.1]: }]
2019-12-09T13:42:07.870213+00:00 app[web.1]: at Pool.<anonymous> (/app/node_modules/mongodb/lib/core/topologies/server.js:433:11)
2019-12-09T13:42:07.870216+00:00 app[web.1]: at Pool.emit (events.js:210:5)
2019-12-09T13:42:07.870218+00:00 app[web.1]: at /app/node_modules/mongodb/lib/core/connection/pool.js:571:14
2019-12-09T13:42:07.870220+00:00 app[web.1]: at /app/node_modules/mongodb/lib/core/connection/pool.js:994:11
2019-12-09T13:42:07.870221+00:00 app[web.1]: at /app/node_modules/mongodb/lib/core/connection/connect.js:40:11
2019-12-09T13:42:07.870223+00:00 app[web.1]: at callback (/app/node_modules/mongodb/lib/core/connection/connect.js:262:5)
2019-12-09T13:42:07.870224+00:00 app[web.1]: at Socket.<anonymous> (/app/node_modules/mongodb/lib/core/connection/connect.js:287:7)
2019-12-09T13:42:07.870226+00:00 app[web.1]: at Object.onceWrapper (events.js:300:26)
2019-12-09T13:42:07.870227+00:00 app[web.1]: at Socket.emit (events.js:210:5)
2019-12-09T13:42:07.870230+00:00 app[web.1]: at emitErrorNT (internal/streams/destroy.js:92:8)
2019-12-09T13:42:07.870231+00:00 app[web.1]: at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
2019-12-09T13:42:07.870233+00:00 app[web.1]: at processTicksAndRejections (internal/process/task_queues.js:80:21)

0 个答案:

没有答案