title: NW.js child_process not working with vue.js app
body: <p>I want to build a vue.js app with node webkit (<a href="https://nwjs.io" rel="nofollow noreferrer">Nw.js</a>).</p>
  
  <p>The app has to exec a binary so I did</p>
  
  <pre><code>const exec = require("child_process").exec;
    exec(
      '"C:\\someBin.exe" /someOptions',
      (e, stdout, stderr) =&gt; {
        if (e instanceof Error) {
          console.error(e);
          throw e;
        }
        console.log("stdout ", stdout);
        console.log("stderr ", stderr);
      }
    );
  </code></pre>
  
  <p>I tried with .exec or .spawn but I always get some strange errors like :</p>
  
  <pre><code>TypeError: (0 , n(...).exec) is not a function
  </code></pre>
  
  <p>It has to be linked with me using vue.js because when I test this code in a simple node webkit app with just a script tag, it works !</p>
  
  <p><strong>Is there some kind of incompatibility between webpack (used by vue.js) and the require keyword of nodejs ?</strong></p>
  
  <p>When printing the content of <em>require("child_process")</em> there's a few things but nothing of what I would expect (no spawn or exec methods). It seems that the require itself is not working for this specific case. But odly it still works for other npm packages that have been installed.</p>
  
  <p>To create the app I use <em>"npm run build"</em> which generates the final files directly in the /dist directory. In this directory I have put the node webkit files so I can just run the node webkit binary from there.</p>