title: exec vs execFile nodeJs
body: <p>I want to run a command in command-prompt using nodejs.<br>
  Based on <a href="https://dzone.com/articles/understanding-execfile-spawn-exec-and-fork-in-node" rel="noreferrer">https://dzone.com/articles/understanding-execfile-spawn-exec-and-fork-in-node</a>, i used </p>
  
  <pre><code>child_process.execFile('protractor', ['./src/convertedJs/tempProtractorconfig.js'], (err, stdout, stderr) =&gt; {}
  </code></pre>
  
  <p>The above code throws a ENOENT error.<br>
  But when i run  </p>
  
  <pre><code>child_process.exec('protractor ./src/convertedJs/tempProtractorconfig.js', (err,stdout,stderr) =&gt; {}`
  </code></pre>
  
  <p>everything works fine.<br>
  Can somebody explain what is happening?</p>