MadLittleMods / node-usb-detection

List USB devices in system and detect changes on them.
MIT License
371 stars 114 forks source link

【prebuild-install】usb-detection-v4.3.0-electron-v70-win32-ia32.tar.gz #88

Closed webees closed 5 years ago

webees commented 5 years ago
nodejs    v10.16.3 32
electron  v5.0.10

use https://github.com/nklayman/vue-cli-plugin-electron-builder

usb-detection-v4.3.0-electron-v70-win32-ia32.tar.gz

> electron-builder install-app-deps

  • electron-builder  version=21.2.0
  • rebuilding native dependencies  dependencies=node-hid@0.7.9, usb-detection@4.3.0 platform=win32 arch=ia32
    prebuild-install http request GET https://github.com/MadLittleMods/node-usb-detection/releases/download/v4.3.0/usb-detection-v4.3.0-electron-v70-win32-ia32.tar.gz
    prebuild-install http 404 https://github.com/MadLittleMods/node-usb-detection/releases/download/v4.3.0/usb-detection-v4.3.0-electron-v70-win32-ia32.tar.gz
    prebuild-install WARN install No prebuilt binaries found (target=5.0.10 runtime=electron arch=ia32 libc= platform=win32)

npm WARN abckey-desktop@0.1.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.7 (node_modules\vue-cli-plugin-electron-builder\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.0.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})

I compiled it this way.

@echo off
cd /d "%~dp0"
color 0A

set msvs_version=2017
set npm_config_target=5.0.10
set npm_config_target_arch=ia32
set npm_config_arch=ia32
set npm_config_runtime=electron
set npm_config_build_from_source=true

cd node_modules\usb-detection
cmd /c node-gyp rebuild

cd ..\node-hid
cmd /c node-gyp rebuild
echo:
pause

But after running...

bindings.js?dfc1:178 Uncaught TypeError: Cannot read property 'indexOf' of undefined
    at Function.getFileName (bindings.js?dfc1:178)
    at bindings (bindings.js?dfc1:82)
    at eval (index.js?8cb0:13)
    at Object../node_modules/usb-detection/index.js (app.js:4426)
    at __webpack_require__ (app.js:770)
    at fn (app.js:130)
    at eval (index.js?1bfd:42)
    at Object../node_modules/@abckey/hid/dist/index.js (app.js:945)
    at __webpack_require__ (app.js:770)
    at fn (app.js:130)
webees commented 5 years ago

see https://nklayman.github.io/vue-cli-plugin-electron-builder/guide/guide.html#native-modules

MadLittleMods commented 5 years ago

Thanks for following up with a link to the solution @webees