Answer the question
In order to leave comments, you need to log in
How to print errors to the console in Node.js, even if the error is in a file included with require?
Just an example:
I insert the line into my index.js: console.log(22)l
As you can see, the error after the closing bracket is not a colon. When I try to run node js, I immediately get an error, and it is indicated in which line it is.
If I add the same code to a file included in index.js using require, then the script just hangs. No errors, just nothing gets executed.
How can I make node give me errors on all files?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question