title: run gradlew from nodejs
body: <p>Trying to run gradlew from nodeJS:</p>
  
  <pre><code>const spawn = require('child_process').spawn;
  const path = require('path');
  
  function run() {
  
      var path_dir = path.resolve('./../movies/VanillaApp/android');
  
      var options = {
          cwd: path_dir
      };
  
      const ls = spawn('gradlew', ['assembleRelease'], options);
  
      ls.stdout.on('data', (data) =&gt; {
          console.log(`stdout: ${data}`);
      });
  
      ls.stderr.on('data', (data) =&gt; {
          console.log(`stderr: ${data}`);
      });
  
      ls.on('close', (code) =&gt; {
          console.log(`child process exited with code ${code}`);
      });
  
  }
  
  
  
  module.exports = {
      run: run
  };
  </code></pre>
  
  <p>terminal equavalent: </p>
  
  <pre><code>&gt; ./gradlew assembleRelease
  </code></pre>
  
  <p>getting:</p>
  
  <pre><code>events.js:154
  throw er; // Unhandled 'error' event
  ^
  
  Error: spawn gradlew ENOENT
  at exports._errnoException (util.js:856:11)
  at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
  at onErrorNT (internal/child_process.js:344:16)
  at _combinedTickCallback (node.js:377:13)
  at process._tickCallback (node.js:401:11)
  at Function.Module.runMain (module.js:449:11)
  at startup (node.js:141:18)
  at node.js:933:3
  </code></pre>
  
  <p><strong>UPDATE:</strong> </p>
  
  <p>I've managed to run in with child_process.exec but not with spawn.</p>