Connect ETIMEDOUT appears when using mongoose.

  mongodb, question
.../node_modules/mongoose/node_modules/mongodb/lib/server.js:235
 process.nextTick(function() { throw err;  })
 ^
 Error: connect ETIMEDOUT
 at exports._errnoException (util.js:746:11)
 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)

In a nutshell, it just doesn’t connect, and then there are two situations.

  1. The MongoDB connected is local
    Then you need to see if your connection string has been written incorrectly and if the default port number has been changed.

  2. The MongoDB connected is on another server.
    Let’s see if there is normal communication between the two servers, then refer to the first point.

I think at the very least, we must ensure that the above is correct.