[Node.js] Show More Lines in a Node.js Error Stack Trace

Sometimes you are one or two lines short from finding the cause of the error in the stack trace but you can't because Nodejs displays only a handful of lines. In this lesson, you will learn how to increase the stack trace limit to show more lines

Error.stackTraceLimit = 15;

main();
function main() {
  one();
}
function one() {
  two();
}
function two() {
  three();
}
function three() {
  four();
}
function four() {
  five();
}
function five() {
  six();
}
function six() {
  seven();
}
function seven() {
  eight();
}
function eight() {
  nine();
}
function nine() {
  ten();
}
function ten() {
  eleven();
}
function eleven() {
  twelve();
}
function twelve() {
  throw new Error("I can't see the whole stack strace");
}
原文地址:https://www.cnblogs.com/Answer1215/p/10321521.html