"I got error in node.js to connect mongo db"


db connection error querySrv ENOTFOUND _mongodb._tcp.nodeapi.vlvom.mongodb.net
(node:7720) UnhandledPromiseRejectionWarning: Error: querySrv ENOTFOUND _mongodb._tcp.nodeapi.vlvom.mongodb.net
    at QueryReqWrap.onresolve [as oncomplete] (dns.js:203:19)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:7720) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:7720) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
GET / 200 66.595 ms - 58

为什么我在node.js中出现上述错误?有人能帮我吗

我解决了我的问题。我的错误的解决方案是我使用node.js最旧的版本,然后我使用最新的版本来解决这个问题。

相关内容

最新更新