-
Notifications
You must be signed in to change notification settings - Fork 114
Node 16 / Electron 15 prebuilds #153
Comments
Node v16 is ABI version 93, and I believe Electron v15 is ABI version 98. The The prebuild CI job happens to run on Node v14, but it is configured to build binaries for all supported ABI versions |
@dopry I had the same issue that I think you're having. If the problem is that you're packaging your Electron app w. something like electron-builder or electron-rebuild, these both use prebuild-install which depends on node-abi v2.x. This version doesn't support Node module 98 so you either need to build |
Oh awesome thanks for the hint. We kinda gave up on it and decided to move to WebHID. If that works proves challenging I'll try updating with force resolution. Is there and upstream issue in prebuild-install I should track? |
Looks like the root issue is electron/rebuild#886. The fix has been merged, but a new version has not yet been cut. Thankfully, there's nothing to be done for this on the usb-detection side to take advantage of this fix whenever it happens, the prebuilds are already in place! This {
"name": "electron-testing",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"preinstall": "npx npm-force-resolutions",
"postinstall": "electron-rebuild"
},
"keywords": [],
"author": "",
"license": "ISC",
"resolutions": {
"node-abi": "^3.2.0"
},
"dependencies": {
"usb-detection": "^4.13.0"
},
"devDependencies": {
"electron": "^15.2.0",
"electron-rebuild": "^3.2.3"
}
} // npx electron index.js
const { app } = require('electron');
const usbDetection = require('usb-detection');
usbDetection.startMonitoring();
usbDetection.find((error, devices) => {
console.log(devices, error);
});
app.once('will-quit', () => usbDetection.stopMonitoring()); |
I was looking at this earlier and, while this should work for allowing electron-rebuild to recognize the correct ABI version, it ultimately still calls prebuild-install for projects like this so I don't think this will solve it. |
@mcous thanks so much for your help today as well. I'm happy if you guys want to close this issue or leave it open until the upstream issues are resolved for people to find more easily. |
@mholtzman yeah, I think you're right. The resolution override only works because it's overriding it in two places. That's... not ideal. @dopry of course! I think this ticket should stay open / possibly pinned, since until upstream issues are resolved, users will be unable to install this package in Electron v15 without the above workarounds |
Followed the above instructions (and package.json) but still getting:
Any advice? |
@dopry it looks like prebuild-install was updated to include a more current version of node-abi, so I think this issue could be fixed by updating to use prebuild-install 7.x |
you used npm-force-resolutions and it still doesn't work? check your package-lock.json file to make sure everything is using node-abi 3.x+ |
I'm not sure whether this is part of your configurations or an upstream thing in
(I know this is in the context of electron, but it's a change in v8 that would happen in any node distribution >=16.9). If you run |
Also fyi: electron/electron#35193 affects this module too - anything that uses |
It looks like prebuilds are being run with node 14. Node 16 is current and Electron 15 has shipped with Node 16. It would be nice to have prebuilts for the current version of node/electron.
The text was updated successfully, but these errors were encountered: