title: Capture tshark stdout output in node.js
body: <p>I'm trying to run tshark from node and retrieve the stdout output using the following code</p>
  
  <pre><code>var spawn = require('child_process').spawn,
      ts = spawn('tshark',
                 ['-i wlan0 -I -R "wlan.fc.type == 0 &amp;&amp; wlan.fc.subtype == 4" -e wlan.sa']
                );
  
  ts.stdout.on('data', function (data) {
      console.log('stdout: ' + data);
  });
  
  ts.stderr.on('data', function (data) {
      console.log('stderr: ' + data);
  });
  
  ts.on('exit', function (code) {
     console.log('child process exited with code ' + code);
  });
  </code></pre>
  
  <p>But I get an error</p>
  
  <p>stderr: Capturing on  wlan0 -I -R "wlan.fc.type == 0 &amp;&amp; wlan.fc.subtype == 4" -T fields -e wlan.sa</p>
  
  <p>stderr: tshark: The capture session could not be initiated (No such device exists).
  Please check to make sure you have sufficient permissions, and that you have the proper interface or pipe specified.</p>
  
  <p>stderr: 0 packets captured</p>
  
  <p>If I run directly tshark with the arguments it works fine.</p>
  
  <p>Any clue of what could be wrong ?</p>