title: How to properly link native modules in an Electron app?
body: <p>I am working on an Electron app where I pretend to use native modules. I need <code>ffi</code> and <code>ref</code> as dependencies in my project. I installed the libraries via npm and rebuilt the modules with <code>node-gyp rebuild</code> as suggested in documentation <a href="https://electronjs.org/docs/tutorial/using-native-node-modules" rel="nofollow noreferrer">Using Native Node Modules</a>. Everything compiled successfully, but when I try to require these libraries I get the following error:</p>
  
  <pre><code>Uncaught Error: Could not locate the bindings file. Tried:
   → C:\Users\Utilizador\Documents\my_app\build\binding.node
   → C:\Users\Utilizador\Documents\my_app\build\Debug\binding.node
   → C:\Users\Utilizador\Documents\my_app\build\Release\binding.node
   → C:\Users\Utilizador\Documents\my_app\out\Debug\binding.node
   → C:\Users\Utilizador\Documents\my_app\Debug\binding.node
   → C:\Users\Utilizador\Documents\my_app\out\Release\binding.node
   → C:\Users\Utilizador\Documents\my_app\Release\binding.node
   → C:\Users\Utilizador\Documents\my_app\build\default\binding.node
   → C:\Users\Utilizador\Documents\my_app\compiled\6.5.0\win32\ia32\binding.node
  </code></pre>
  
  <p>It is odd that the search paths do not correspond to library path, which should be pointing to <code>node_modules</code>. I can't figure out what is causing this problem.</p>
  
  <p>Any help will be appreciated, thank you in advance.</p>