【发布时间】:2021-08-07 14:37:57
【问题描述】:
短版: 我正在寻找一种方法来使用 nodeJS 提供的“--trace-warnings”标志来运行我的 NestJS 应用程序。有没有办法做到这一点,或者 NestJS 是否提供类似的东西?
加长版:
嗨! NestJS 菜鸟在这里。我正在尝试运行我正在开发的 NestJS 应用程序的开发版本。但是,在启动应用程序时,我收到以下错误。
显然,它在某处遗漏了一个 catcherror!但是,开发版有很多更新,而且这个错误可能出现在任何地方,所以我希望找到一种比检查每个新功能更有效的方法来发现这个错误!在错误消息中,有一些关于在启动应用程序时运行标志的提示 (node --trace-warnings ...)。但是,这些是针对 node 而不是 NestJS。
所以我的问题是;有什么方法可以使用 --trace-warnings 标志运行 NestJS 或其他一些有效的方法来找到我错过了 catcherror 的位置?
提前致谢!
错误:
(node:72899) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:72899) 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:72899) [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.
(node:72899) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
(node:72899) 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: 2)
【问题讨论】:
-
你好像没有开启redis
标签: nestjs