I am building an desktop app using Angular 7 and Electron 7. I need to read connected USB device details. To be specific I need to read connected USB barcode scanner serial number. Debian version of my app is working perfectly with below code:
var HID = require('node-hid');
var devices = HID.devices();
console.log(devices);
When I try this same code in Win32 version of my app, it generates this below error:
tmp.node is not a valid Win32 application
..\resources\app.asar\node_modules\express\lib\application.js:630 Error: ..\AppData\Local\Temp\95434314-b7bd-4c9a-8413-b9c602346bd1.tmp.node is not a valid Win32 application. ..\AppData\Local\Temp\95434314-b7bd-4c9a-8413-b9c602346bd1.tmp.node at process.func [as dlopen] (electron/js2c/asar.js:155:31) at Object.Module._extensions..node (internal/modules/cjs/loader.js:881:18) at Object.func [as .node] (electron/js2c/asar.js:164:18) at Module.load (internal/modules/cjs/loader.js:701:32) at tryModuleLoad (internal/modules/cjs/loader.js:633:12) at Function.Module._load (internal/modules/cjs/loader.js:625:3) at Module.require (internal/modules/cjs/loader.js:739:19) at require (internal/modules/cjs/helpers.js:14:16) at bindings (..\AppData\Local\retailpos\app-1.0.0\resources\app.asar\node_modules\bindings\bindings.js:112:48) at loadBinding (..\AppData\Local\retailpos\app-1.0.0\resources\app.asar\node_modules\node-hid\nodehid.js:25:42)
I am looking for a solve more than a week now. Can't find any solved answer. I have checked that electron-rebuild is working properly.
This issue has been solved when I created a Windows Build from a windows system. According to my understanding - Cross origin OS build was generating that issue.