title: Run a Cli command from an Electron packaged app
body: <p>I'm writing a Mac OSX GUI with <a href="http://electron.atom.io/" rel="nofollow">Electron</a> and <a href="https://github.com/jiahaog/nativefier" rel="nofollow">Nativefier</a> package and when i run the packaged app on a machine with Nodejs installed (globally), everything works fine.<br>
  On a machine without Nodejs installed the command can't be found.</p>
  
  <p>I'm using the Nativefier Cli inside Electron with a full path to cli:</p>
  
  <pre><code>var cliCmd = '"'+app.getAppPath()+'/node_modules/nativefier/lib/cli.js"';
  
  const child_process = require('child_process');
  child_process.exec(cliCmd+' --name "App Name" "http://appname.tld" --platform darwin --arch x64 --electron-version "0.36.6"', function (error, stdout, stderr) {
    if (error) {
      console.error(`exec error: ${error}`);
      return;
    }
    console.log(`stdout: ${stdout}`);
    console.log(`stderr: ${stderr}`);
  });
  </code></pre>
  
  <p>I'm getting this error: <code>"env: node: No such file or directory"</code><br>
  Checked the <code>app.getAppPath()</code> dir and it's correct.</p>
  
  <p>Also, i tried to pass the <code>env</code> and <code>cwd</code> parameters, but without any success.</p>
  
  <pre><code>child_process.exec(cliCmd+' --name "App Name" "http://appname.tld" --platform darwin --arch x64 --electron-version "0.36.6"',
  {
    env: {"ATOM_SHELL_INTERNAL_RUN_AS_NODE":"1"},
    cwd: app.getAppPath()
  },
  function (error, stdout, stderr) {
    if (error) {
      console.error(`exec error: ${error}`);
      return;
    }
    console.log(`stdout: ${stdout}`);
    console.log(`stderr: ${stderr}`);
  });
  </code></pre>
  
  <p>What i'm doing wrong? I tried <code>child_process.spawn()</code> also, but without any luck again.<br>
  What i need to do to call a packaged node_module/cli from my app, on a machine without nodejs installed?</p>