【问题标题】:How to set maximum stack size in node.js? [duplicate]如何在 node.js 中设置最大堆栈大小? [复制]
【发布时间】:2015-08-08 04:51:04
【问题描述】:

将 docx 转换为 epub 时出错。

我增加了堆栈大小,但任务是徒劳的。

错误:

 RangeError: Maximum call stack size exceeded
at Array.filter (native)
at writeAll (D:\xxx\WorkingFolder\xxxx\public\node_modules\mammoth\lib\html-generator.js:73:15)
at Object.text (D:\xxxx\WorkingFolder\ACS_Live\public\node_modules\mammoth\lib\html-generator.js:12:13)
at DocumentConversion.elementConverters.text (D:\xxxx\WorkingFolder\x_x\public\node_modules\mammoth\lib\document-to-html.js:229:18)
at elementToHtml (D:\xxxx\WorkingFolder\xx_xx\public\node_modules\mammoth\lib\document-to-html.js:71:13)
at eval (D:\xxxx\WorkingFolder\xxxx\public\node_modules\mammoth\lib\document-to-html.js:64:20)
at iterate (D:\xxx\WorkingFolder\xxx_Live\public\node_modules\mammoth\node_modules\async\lib\async.js:134:13)
at Object.async.eachSeries (D:\xxx\WorkingFolder\xxx_Live\public\node_modules\mammoth\node_modules\async\lib\async.js:150:9)
at convertElements (D:\xxx\WorkingFolder\xxx_Live\public\node_modules\mammoth\lib\document-to-html.js:63:15)
at convertRun (D:\xxxx\WorkingFolder\xxx_Live\public\node_modules\mammoth\lib\document-to-html.js:122:9)
at elementToHtml (D:\xxx\WorkingFolder\xxx_Live\public\node_modules\mammoth\lib\document-to-html.js:71:13)
at eval (D:\xxxx\WorkingFolder\xxx_Live\public\node_modules\mammoth\lib\document-to-html.js:64:20)

解决方法:其实这不是node.js的错误,而是mammoth(见上面的错误日志)。将 doc 转换为 epub 时,样式未转换。那就是没有适当的有效文件。我检查并删除了那些页面。现在它工作正常。

【问题讨论】:

    标签: javascript node.js pandoc


    【解决方案1】:

    使用
    node --stack-size=val 更改最大堆栈大小。

    【讨论】:

    • 这是duplicate,但我不知道如何标记重复项。我没有足够的权限吗?任何人都可以在 cmets 给我小费吗?谢谢..
    • 在问题中点击“关闭”并选择原因“重复...”并添加您的链接问题。
    • 我正在使用 Windows。 “val”的值是多少?它不接受申请。
    • 'Val' 可以是您喜欢的任何数字,但我希望您的问题可能更多地与您正在运行的代码有关,而不是任何可以通过手动增加堆栈大小来解决的问题。你怎么看?
    • 是的。但我不知道处理大文件的最大大小(客户端可以使用任何大小),我想在我的计算机中配置全局大小。这是非常基本的,因为我是新手。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-06-30
    • 2020-08-05
    • 2014-01-23
    • 2014-07-31
    • 2018-09-21
    • 1970-01-01
    相关资源
    最近更新 更多