title: How can I bundle a precompiled binary with electron
body: <p>I am trying to include a precompiled binary with an electron app.  I began with electron quick start app and modified my <code>renderer.js</code> file to include this code that is triggered when a file is dropped on the body:</p>
  
  <pre class="lang-js prettyprint-override"><code>spawn = require('child_process').spawn,
    ffmpeg = spawn('node_modules/.bin/ffmpeg', ['-i', clips[0], '-an', '-q:v', '1', '-vcodec', 'libx264', '-y', '-pix_fmt', 'yuv420p', '-vf', 'setsar=1,scale=trunc(iw/2)*2:trunc(ih/2)*2,crop=in_w:in_h-50:0:50', '/tmp/out21321.mp4']);
  
  ffmpeg.stdout.on('data', data =&gt; {
    console.log(`stdout: ${data}`);
  });
  ffmpeg.stderr.on('data', data =&gt; {
    console.log(`stderr: ${data}`);
  });
  </code></pre>
  
  <p>I have placed my precompiled <strong>ffmpeg</strong> binary in <code>node_modules/.bin/</code>.  Everything works great in the dev panel, but when I use electron-packager to set up the app, it throws a <code>spawn error ENOENT</code> to the console when triggered.  I did find a <a href="https://stackoverflow.com/questions/33152533/bundling-precompiled-binary-into-electron-app?s=1%7C0.5909">very similar question</a> on SO, but the question doesn't seem to be definitively answered.  The  <a href="https://www.npmjs.com/package/electron-packager" rel="noreferrer">npm page on electron-packager</a> does show that they can be bundled, but I cannot find any documentation on how to do so.</p>