title: Error: spawn ENOENT on Windows
body: <p>I'm on node v4.4.0 and on Windows 10. I'm using bunyan to log my node application.</p>
  
  <pre><code>try {
      var fs = require('fs');
      var path = require('path');
      var spawn = require('child_process').spawn;
      var through = require('through');
  } catch (err) {
      throw err;
  }
  
  var prettyStream = function () {
      // get the binary directory of bunyan
      var bin = path.resolve(path.dirname(require.resolve('bunyan')), '..', 'bin', 'bunyan');
      console.log(bin); // this outputs C:\www\nodeapp\src\node_modules\bunyan\bin\bunyan, the file does exist
  
      var stream = through(function write(data) {
          this.queue(data);
      }, function end() {
          this.queue(null);
      });
  
      // check if bin var is not empty and that the directory exists
      if (bin &amp;&amp; fs.existsSync(bin)) {
          var formatter = spawn(bin, ['-o', 'short'], {
              stdio: [null, process.stdout, process.stderr]
          });
          // stream.pipe(formatter.stdin); // &lt;- did this to debug
      }
  
      stream.pipe(process.stdout); // &lt;- did this to debug
  
      return stream;
  }
  </code></pre>
  
  <p>The logging spits out in the console due to the fact I used <code>stream.pipe(process.stdout);</code>, i did this to debug the rest of the function.</p>
  
  <p>I however receive the error:</p>
  
  <pre><code>Error: spawn C:\www\nodeapp\src\node_modules\bunyan\bin\bunyan ENOENT
      at exports._errnoException (util.js:870:11)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
      at onErrorNT (internal/child_process.js:344:16)
      at nextTickCallbackWith2Args (node.js:442:9)
      at process._tickCallback (node.js:356:17)
      at Function.Module.runMain (module.js:443:11)
      at startup (node.js:139:18)
      at node.js:968:3
  </code></pre>
  
  <p>I'm guessing this is a Windows error. Anyone have any ideas?</p>