title: Why would calling a child_process command work with exec but not spawn?
body: <p>Why would this work:</p>
  
  <pre><code>var exec = require("child_process").exec;
  var command = exec("grunt");
  </code></pre>
  
  <p>But this throws an error:</p>
  
  <pre><code>var spawn = require("child_process").spawn;
  var command = spawn("grunt");
  </code></pre>
  
  <p>The error it throws is <code>Error: spawn ENOENT</code></p>
  
  <p>At first I thought it might have something to do with the <code>env</code>, but it is exactly the same in both <code>exec</code> and <code>spawn.</code>  I think it must somehow have something to do with Grunt, since trying <code>git</code> works in both.</p>