This is a micro post with a tip that I’ll need to remember again in the months to come. Node.js can emit warnings on the terminal saying that a rejected promise wasn’t caught, or calling an asynchronous function without callback is deprecated.
But where exactly is the original call that causes that warning?
[](https://training.leftlogic.com/buy/terminal/cli2?coupon=BLOG\&utm_source=blog\&utm_medium=banner\&utm_campaign=remysharp-discount)
[READER DISCOUNTSave $50 on terminal.training](https://training.leftlogic.com/buy/terminal/cli2?coupon=BLOG\&utm_source=blog\&utm_medium=banner\&utm_campaign=remysharp-discount)
[I’ve published 38 videos for new developers, designers, UX, UI, product owners and anyone who needs to conquer the command line today.](https://training.leftlogic.com/buy/terminal/cli2?coupon=BLOG\&utm_source=blog\&utm_medium=banner\&utm_campaign=remysharp-discount)
[$49 - only from this link](https://training.leftlogic.com/buy/terminal/cli2?coupon=BLOG\&utm_source=blog\&utm_medium=banner\&utm_campaign=remysharp-discount)

Passing the command line argument --trace-warnings
gives me a full stacktrace to the originating call that triggered the node warning:

Note that even though I’m using mocha (via [npx](https://www.npmjs.com/package/npx)) the noe argument is still correctly passed on to node to give me the stacktrace.
You can even go a little further an include a module like [clarify](https://www.npmjs.com/package/clarify) to strip the node internals from the stacktrace which makes it a little easier to read.
Published 4-Dec 2017 under #code. [Edit this post](https://github.com/remy/remysharp.com/blob/main/public/blog/where-do-those-node-warnings-come-from.md)