如何增加Node.js中的最大调用堆栈大小 [英] How can I increase the maximum call stack size in Node.js
本文介绍了如何增加Node.js中的最大调用堆栈大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这与有关Node中的错误消息的其他问题不同,该错误消息显示为 RangeError:超出了最大调用堆栈大小,因为我确切地知道为什么收到此错误消息.之所以发生这种情况,是因为我要递归,实际上实际上要递归很多.
This is different to other questions regarding an error message in Node that reads RangeError: Maximum call stack size exceeded in that I know exactly why I'm getting this error message. It's happening because I'm recursing, recursing quite a lot in fact.
谢谢.
推荐答案
来自node --help
:
node --max-stack-size=val
更新:如注释所示,即使帮助文本仍列出了--max-stack-size
选项,在节点v0.10.x中,您仍需要使用--stack-size
.
Update: as the comments indicate, even though the help text still lists the --max-stack-size
option, in node v0.10.x you need to use --stack-size
instead.
node --stack-size=val
这篇关于如何增加Node.js中的最大调用堆栈大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文