Hi @afhaque ,
Hope you're keeping safe.
@afhaque please see this code. And let me know what's the problem.
D:\MeanMapAppV2.0>npm start
[email protected] start
node server.js
App listening on port 3000
(node:41260) DeprecationWarning: open()
is deprecated in mongoose >= 4.11.0, use openUri()
instead, or set the useMongoClient
option if using connect()
or createConnection()
. See http://mongoosejs.com/docs/4.x/docs/connections.html#use-mongo-client
(Use node --trace-deprecation ...
to show where the warning was created)
node:events:355
throw er; // Unhandled 'error' event
^
Error [MongoError]: failed to connect to server [ds139817.mlab.com:39817] on first connect [Error: connect ETIMEDOUT 34.239.25.165:39817
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1137:16) {
name: 'MongoError'
}]
at Pool. (D:\MeanMapAppV2.0\node_modules\mongodb-core\lib\topologies\server.js:336:35)
at Pool.emit (node:events:378:20)
at Connection. (D:\MeanMapAppV2.0\node_modules\mongodb-core\lib\connection\pool.js:280:12)
at Object.onceWrapper (node:events:485:26)
at Connection.emit (node:events:378:20)
at Socket. (D:\MeanMapAppV2.0\node_modules\mongodb-core\lib\connection\connection.js:189:49)
at Object.onceWrapper (node:events:485:26)
at Socket.emit (node:events:378:20)
at emitErrorNT (node:internal/streams/destroy:188:8)
at emitErrorCloseNT (node:internal/streams/destroy:153:3)
at processTicksAndRejections (node:internal/process/task_queues:81:21)
Emitted 'error' event on NativeConnection instance at:
at Immediate. (D:\MeanMapAppV2.0\node_modules\mongoose\lib\connection.js:325:19)
at processImmediate (node:internal/timers:464:21)
D:\MeanMapAppV2.0>node --trace-deprecation ... '
node' is not recognized as an internal or external command,
operable program or batch file.
D:\MeanMapAppV2.0>npm start
[email protected] start
node server.js
App listening on port 3000
(node:34692) DeprecationWarning: open()
is deprecated in mongoose >= 4.11.0, use openUri()
instead, or set the useMongoClient
option if using connect()
or createConnection()
. See http://mongoosejs.com/docs/4.x/docs/connections.html#use-mongo-client
(Use node --trace-deprecation ...
to show where the warning was created)
(node:34692) DeprecationWarning: Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html
GET /favicon.ico 404 7.727 ms - 150
node:events:355
throw er; // Unhandled 'error' event
^
Error [MongoError]: failed to connect to server [ds139817.mlab.com:39817] on first connect [Error: connect ETIMEDOUT 34.239.25.165:39817
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1137:16) {
name: 'MongoError'
}]
at Pool. (D:\MeanMapAppV2.0\node_modules\mongodb-core\lib\topologies\server.js:336:35)
at Pool.emit (node:events:378:20)
at Connection. (D:\MeanMapAppV2.0\node_modules\mongodb-core\lib\connection\pool.js:280:12)
at Object.onceWrapper (node:events:485:26)
at Connection.emit (node:events:378:20)
at Socket. (D:\MeanMapAppV2.0\node_modules\mongodb-core\lib\connection\connection.js:189:49)
at Object.onceWrapper (node:events:485:26)
at Socket.emit (node:events:378:20)
at emitErrorNT (node:internal/streams/destroy:188:8)
at emitErrorCloseNT (node:internal/streams/destroy:153:3)
at processTicksAndRejections (node:internal/process/task_queues:81:21)
Emitted 'error' event on NativeConnection instance at:
at Immediate. (D:\MeanMapAppV2.0\node_modules\mongoose\lib\connection.js:325:19)
at processImmediate (node:internal/timers:464:21)