jangxx/node-ViGEmClient

Installed and Built but having issues resolving build files

Closed this issue · 1 comments

Files are installed and built correctly yet it is not able to resolve the built files. I'm assuming its the vigemclient.node file it's looking for, and I can see it in ../build/Release/. Any solutions on how to resolve this issue?

`[ERROR] Could not resolve "../build/Release/vigemclient"

node_modules/vigemclient/lib/ViGEmClient.js:1:28:
  1 │ const vigemclient = require('../build/Release/vigemclient');
    ╵                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/vigemclient/lib/X360Controller.js:1:28:
  1 │ const vigemclient = require('../build/Release/vigemclient');
    ╵                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/vigemclient/lib/DS4Controller.js:1:28:
  1 │ const vigemclient = require('../build/Release/vigemclient');
    ╵                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/vigemclient/lib/ViGEmTarget.js:3:28:
  3 │ const vigemclient = require('../build/Release/vigemclient');
    ╵                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

Are you trying to use it in electron and bundling it with something like angular? This is not going to work, since it is a native module. You can check out this stackoverflow question for more info.

The way you should probably solve this is by using the native libraries in the main electron file and then using messages to communicate between it and your "frontend".

Or you can try to do what the comments of that stackoverflow thread said and put the module into the externals so it doesn't get bundled. I'm not sure that is going to work though, since I haven't really used electron in many years and have no concrete idea of how it currently works.