spawn in javascript : delayed stdout , how to disable buffer?
<p>I'm trying to execute a program (binary), that is printing values regularly on the stdout.</p>

<p>with exec, it works fine, but with spawn, results only comes after a while, why ? what can I do about that ?</p>

<pre><code>  const opcv=spawn("myprog",["-L","2","-o","pairs","-r"], { shell:false, stdio:"pipe" })
  opcv.stdout.on('data', (data) =&gt; {
      node.log("opcdata stdout=" + data);
    });
  opcv.stderr.on('data', (data) =&gt; {
      node.log("opcdata stderr=" + data);
    });
</code></pre>

<p>I tried whith the option {stdio:"inherit"}, in that case I see the data directly, but I'm not able to work with ".stdout.on(" anymore :</p>

<blockquote>
  <p>TypeError: Cannot read property 'on' of null</p>
</blockquote>

<p><strong>EDIT</strong>
It seems to be linked with the program I'm trying to run, but unfortunately its not possible to disable stdout buffering in the program, is it possible to execute it with another shell than cmd , or are they other tricks ?</p>