title: How to run tensorflow.js with Electron?
body: <p>I can not run tensorflow.js with electron, please help. <br> <br>
  <strong><em>What I have:</em></strong> <br/>
   1. Windows 10 Version 1903 <br/>
   2. python 2.7 <br/>
   3. node 12.13.1 <br/>
   4. npm 6.13.1 <br/>
   5. node-pre-gyp 0.14.0, installed globally <br/></p>
  
  <p><strong><em>What I did:</em></strong> <br/>
   1. Cloned electron-quick-start from Electron documentation (<a href="https://github.com/electron/electron-quick-start" rel="nofollow noreferrer">https://github.com/electron/electron-quick-start</a>). <br/>
   2. Ran npm insntall and npm start to enshure everything works fine. <br/>
   3. Installed @tensorflow/tfjs-node:</p>
  
  <pre><code>npm install @tensorflow/tfjs-node
  
  &gt; @tensorflow/tfjs-node@1.4.0 install C:\Users\proxc\Desktop\electron-quick-start-master\node_modules\@tensorflow\tfjs-node 
  &gt; node scripts/install.js
  
  CPU-windows-1.4.0.zip
  * Downloading libtensorflow
  [==============================] 2299069/bps 100% 0.0s
  [==============================] 1212292/bps 100% 0.0s
  * Building TensorFlow Node.js bindings
  + @tensorflow/tfjs-node@1.4.0
  added 74 packages from 48 contributors and audited 256 packages in 30.48s
  
  2 packages are looking for funding
    run `npm fund` for details
  
  found 0 vulnerabilities
  </code></pre>
  
  <p><br/>
  4. Added line in preload.js <br/></p>
  
  <pre><code>const tf = require('@tensorflow/tfjs-node');
  </code></pre>
  
  <p><br/>
  5. Ran npm start: <br/></p>
  
  <pre><code>npm start
  
  &gt; electron-quick-start@1.0.0 start C:\Users\proxc\Desktop\electron-quick-start-master
  &gt; electron .
  
  
   node-pre-gyp info This Node instance does not support builds for N-API version 5
  node-pre-gyp info This Node instance does not support builds for N-API version 5
  </code></pre>
  
  <p>And in app console: <br/></p>
  
  <pre><code>Platform browser has already been set. Overwriting the platform with [object Object].
  Environment.setPlatform @ C:\Users\proxc\Desktop\electron-quick-start-master\node_modules\@tensorflow\tfjs-core\dist\environment.js:38
  init.ts:204 Unable to load preload script: C:\Users\proxc\Desktop\electron-quick-start-master\preload.js
  (anonymous) @ init.ts:204
  init.ts:205 Error: Cannot find module 'C:\Users\proxc\Desktop\electron-quick-start-master\node_modules\@tensorflow\tfjs-node\lib\napi-v4\tfjs_binding.node'
  Require stack:
  - C:\Users\proxc\Desktop\electron-quick-start-master\node_modules\@tensorflow\tfjs-node\dist\index.js
  - C:\Users\proxc\Desktop\electron-quick-start-master\preload.js
      at Module._resolveFilename (internal/modules/cjs/loader.js:717)
      at Function../lib/common/reset-search-paths.ts.Module._resolveFilename (reset-search-paths.ts:40)
      at Module._load (internal/modules/cjs/loader.js:622)
      at Module._load (electron/js2c/asar.js:717)
      at Function.Module._load (electron/js2c/asar.js:717)
      at Module.require (internal/modules/cjs/loader.js:775)
      at require (internal/modules/cjs/helpers.js:68)
      at Object.&lt;anonymous&gt; (C:\Users\proxc\Desktop\electron-quick-start-master\node_modules\@tensorflow\tfjs-node\dist\index.js:44)
      at Object.&lt;anonymous&gt; (C:\Users\proxc\Desktop\electron-quick-start-master\node_modules\@tensorflow\tfjs-node\dist\index.js:66)
      at Module._compile (internal/modules/cjs/loader.js:880)
  </code></pre>
  
  <p><strong><em>What I tried:</em></strong> <br/>
  1. Node version 13.3.0 <br/>
  2. <code>npm rebuild @tensorflow/tfjs-node --build-from-source</code> <br/>
  3. Deleting node_modules and running scripts again <br/>
  4. Deleting the project and doing all over again</p>
  
  <p><strong><em>May be interesting:</em></strong> <br/>
  1. <code>node_modules\@tensorflow\tfjs-node\lib</code> does not contain <code>napi-4</code>, but contains <code>napi-5</code> <br/></p>