RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]:stdout maxBuffer length exceeded
Asked Answered
T

1

9

I get this error enter image description here

when running this block of code,

 reasoner = new Reasoner({
    type: 'local', 
    folder: 'csp_files' 
 });

 console.log("solving Model");
 reasoner.solve(Model, (err, stdout, stderr, isSatisfiable) => {
    console.log("isSatisfiable");
    console.log(isSatisfiable);
    if (err) {
        // manage error
        console.log("model error");
        future_response.return("model error");
    } else {
        // manage solution
        console.log(stdout);
        console.log(isSatisfiable);
        future_response.return(stdout);
    }
 });
 console.log("Model solved");
 return future_response.wait();

from what I have read I should find a way to rewrite the stdout to support bigger buffer length, could someone please advice how I could do it? I believe that the library spawn is what I should use, right? I use node version 12.16.1 and meteor

Template answered 1/5, 2020 at 10:2 Comment(0)
P
4

You need to use and set the maxBuffer option when using child_process.exec. From the : documentation

It is - the differences between spawn() and exec() of Node's child_process. Use spawn() when you want the child process to return huge binary data to Node, use exec() when you want the child process to return simple status messages.

Pythia answered 11/2, 2021 at 6:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.