title: Electron js: use npm internally/programmatically
body: <p>I wrote an app with Electron js that encapsulate Ionic apps for editing them live.
  So i use a child process to <code>cd {ionic app path} &amp;&amp; ionic serve</code>/<code>npm install</code>/<code>npm update</code> for serving and updating packages of the live Ionic app in my Electron container.
  No problems with this technique on my side. But when i package my app and use an installer to test it on a clean machine, npm cannot be executed because of nodejs that is not installed on it.</p>
  
  <p>First I was thinking of including a nodejs installer into my main app installer but this does not seem to me that is the good way of doing it.</p>
  
  <p>And after digging on stackoverflow I've found this thread: <a href="https://stackoverflow.com/questions/20686244/install-programmatically-a-npm-package-providing-its-version">Install programmatically a NPM package providing its version</a>
  that explain how to use npm directly in my code with <code>require("npm");</code> and that's worked but i was not able to tell <code>npm.install()</code> in which folder i want to run this command what was possible with child process.</p>
  
  <p>I has tried to read the lib but this not seams to be possible: <a href="https://github.com/npm/npm/blob/latest/lib/install.js" rel="nofollow noreferrer">https://github.com/npm/npm/blob/latest/lib/install.js</a></p>
  
  <p><strong>Do you have any idea what I can do to solve this problem ?</strong></p>