OpenWonderLabs / homebridge-switchbot

The Homebridge SwitchBot plugin allows you to access your SwitchBot Device(s) from HomeKit. Homebridge.
https://www.switch-bot.com/
ISC License
229 stars 47 forks source link

libudev.h: No such file or directory #986

Closed AndShezar closed 1 week ago

AndShezar commented 2 weeks ago

Describe Your Problem

When installing the plugin in hoobs, the installation fails with error: /libusb/libusb/os/linux_udev.c:28:10: fatal error: libudev.h: No such file or directory 28 | #include

Relevant log output

hoobs@hoobs:/var/lib/hoobs$ sudo hbs plugin add @switchbot/homebridge-switchbot
? Please select an bridge Switchbot Bridge
yarn add v1.22.18
info No lockfile found.
[1/4] Resolving packages...
warning @switchbot/homebridge-switchbot > async-mqtt > mqtt > help-me > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning @switchbot/homebridge-switchbot > node-switchbot > @abandonware/bluetooth-hci-socket > @mapbox/node-pre-gyp > npmlog@5.0.1: This package is no longer supported.
warning @switchbot/homebridge-switchbot > node-switchbot > @abandonware/bluetooth-hci-socket > @mapbox/node-pre-gyp > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
warning @switchbot/homebridge-switchbot > node-switchbot > @abandonware/bluetooth-hci-socket > @mapbox/node-pre-gyp > rimraf > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning @switchbot/homebridge-switchbot > async-mqtt > mqtt > help-me > glob > inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning @switchbot/homebridge-switchbot > node-switchbot > @abandonware/bluetooth-hci-socket > @mapbox/node-pre-gyp > npmlog > gauge@3.0.2: This package is no longer supported.
warning @switchbot/homebridge-switchbot > node-switchbot > @abandonware/bluetooth-hci-socket > @mapbox/node-pre-gyp > npmlog > are-we-there-yet@2.0.0: This package is no longer supported.
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/3] ⢀ usb
[-/3] ⠠ waiting...
warning Error running install script for optional dependency: "/var/lib/hoobs/switchbotbridge/node_modules/usb: Command failed.
Exit code: 1
Command: node-gyp-build
Arguments: 
Directory: /var/lib/hoobs/switchbotbridge/node_modules/usb
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@10.1.0
gyp info using node@16.19.1 | linux | arm
gyp info find Python using Python version 3.9.2 found at \"/usr/bin/python3\"

gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args '/var/lib/hoobs/switchbotbridge/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/var/lib/hoobs/switchbotbridge/node_modules/usb/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/var/lib/hoobs/switchbotbridge/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/root/.cache/node-gyp/16.19.1/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/16.19.1',
gyp info spawn args '-Dnode_gyp_dir=/var/lib/hoobs/switchbotbridge/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/16.19.1/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/var/lib/hoobs/switchbotbridge/node_modules/usb',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/var/lib/hoobs/switchbotbridge/node_modules/usb/build'
  CC(target) Release/obj.target/libusb/libusb/libusb/core.o
  CC(target) Release/obj.target/libusb/libusb/libusb/descriptor.o
  CC(target) Release/obj.target/libusb/libusb/libusb/hotplug.o
  CC(target) Release/obj.target/libusb/libusb/libusb/io.o
  CC(target) Release/obj.target/libusb/libusb/libusb/strerror.o
  CC(target) Release/obj.target/libusb/libusb/libusb/sync.o
  CC(target) Release/obj.target/libusb/libusb/libusb/os/events_posix.o
  CC(target) Release/obj.target/libusb/libusb/libusb/os/threads_posix.o
  CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_usbfs.o
  CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_udev.o
../libusb/libusb/os/linux_udev.c:28:10: fatal error: libudev.h: No such file or directory
   28 | #include <libudev.h>
      |          ^~~~~~~~~~~
compilation terminated.
make: *** [libusb.target.mk:156: Release/obj.target/libusb/libusb/libusb/os/linux_udev.o] Error 1
make: Leaving directory '/var/lib/hoobs/switchbotbridge/node_modules/usb/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.<anonymous> (/var/lib/hoobs/switchbotbridge/node_modules/node-gyp/lib/build.js:209:23)
gyp ERR! System Linux 5.15.84-v7+
gyp ERR! command \"/usr/bin/node\" \"/var/lib/hoobs/switchbotbridge/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"
gyp ERR! cwd /var/lib/hoobs/switchbotbridge/node_modules/usb
gyp ERR! node -v v16.19.1
gyp ERR! node-gyp -v v10.1.0
success Saved lockfile.
success Saved 194 new dependencies.
info Direct dependencies
└─ @switchbot/homebridge-switchbot@3.5.0
info All dependencies
├─ @abandonware/bluetooth-hci-socket@0.5.3-12
├─ @abandonware/noble@1.9.2-25
├─ @homebridge/plugin-ui-utils@1.0.3
├─ @isaacs/cliui@8.0.2
├─ @leichtgewicht/ip-codec@2.0.5
├─ @mapbox/node-pre-gyp@1.0.11
├─ @npmcli/agent@2.2.2
├─ @npmcli/fs@3.1.1
├─ @pkgjs/parseargs@0.11.0
├─ @switchbot/homebridge-switchbot@3.5.0
├─ abbrev@1.1.1
├─ agent-base@7.1.1
├─ aggregate-error@3.1.0
├─ ansi-styles@4.3.0
├─ aproba@2.0.0
├─ are-we-there-yet@2.0.0
├─ array-buffer-byte-length@1.0.1
├─ array-flatten@2.1.2
├─ async-mqtt@2.6.3
├─ available-typed-arrays@1.0.7
├─ balanced-match@1.0.2
├─ base64-js@1.5.1
├─ bignumber.js@9.1.2
├─ bl@4.1.0
├─ bonjour-hap@3.7.2
├─ brace-expansion@2.0.1
├─ buffer-equal-constant-time@1.0.1
├─ buffer-from@1.1.2
├─ buffer@5.7.1
├─ cacache@18.0.3
├─ chalk@5.3.0
├─ chownr@2.0.0
├─ clean-stack@2.2.0
├─ color-convert@2.0.1
├─ color-name@1.1.4
├─ color-support@1.1.3
├─ commist@1.1.0
├─ concat-map@0.0.1
├─ concat-stream@2.0.0
├─ console-control-strings@1.1.0
├─ cross-spawn@7.0.3
├─ deep-equal@2.2.3
├─ delegates@1.0.0
├─ detect-libc@2.0.3
├─ dns-packet@5.6.1
├─ duplexify@4.1.3
├─ eastasianwidth@0.2.0
├─ ecdsa-sig-formatter@1.0.11
├─ encoding@0.1.13
├─ end-of-stream@1.4.4
├─ env-paths@2.2.1
├─ err-code@2.0.3
├─ es-get-iterator@1.1.3
├─ exponential-backoff@3.1.1
├─ fakegato-history@0.6.4
├─ for-each@0.3.3
├─ foreground-child@3.2.0
├─ fs-minipass@2.1.0
├─ fs.realpath@1.0.0
├─ functions-have-names@1.2.3
├─ gauge@3.0.2
├─ gcp-metadata@6.1.0
├─ glob@10.4.1
├─ google-auth-library@9.11.0
├─ googleapis-common@7.2.0
├─ googleapis@140.0.0
├─ graceful-fs@4.2.11
├─ gtoken@7.1.0
├─ has-bigints@1.0.2
├─ has-proto@1.0.3
├─ has-symbols@1.0.3
├─ has-unicode@2.0.1
├─ hb-lib-tools@2.0.2
├─ help-me@3.0.0
├─ homebridge-lib@7.0.3
├─ http-cache-semantics@4.1.1
├─ http-proxy-agent@7.0.2
├─ https-proxy-agent@7.0.4
├─ iconv-lite@0.6.3
├─ ieee754@1.2.1
├─ imurmurhash@0.1.4
├─ indent-string@4.0.0
├─ inflight@1.0.6
├─ inherits@2.0.4
├─ internal-slot@1.0.7
├─ ip-address@9.0.5
├─ is-array-buffer@3.0.4
├─ is-bigint@1.0.4
├─ is-boolean-object@1.1.2
├─ is-callable@1.2.7
├─ is-date-object@1.0.5
├─ is-lambda@1.0.1
├─ is-map@2.0.3
├─ is-number-object@1.0.7
├─ is-regex@1.1.4
├─ is-set@2.0.3
├─ is-shared-array-buffer@1.0.3
├─ is-stream@2.0.1
├─ is-string@1.0.7
├─ is-symbol@1.0.4
├─ is-weakmap@2.0.2
├─ is-weakset@2.0.3
├─ isexe@2.0.0
├─ jackspeak@3.4.0
├─ js-sdsl@4.3.0
├─ jsbn@1.1.0
├─ json-bigint@1.0.0
├─ jwa@2.0.0
├─ leven@2.1.0
├─ make-dir@3.1.0
├─ make-fetch-happen@13.0.1
├─ minimatch@9.0.4
├─ minimist@1.2.8
├─ minipass-collect@2.0.1
├─ minipass-fetch@3.0.5
├─ minipass-sized@1.0.3
├─ minizlib@2.1.2
├─ mkdirp@1.0.4
├─ mqtt-packet@6.10.0
├─ mqtt@4.3.8
├─ ms@2.1.2
├─ multicast-dns-service-types@1.1.0
├─ multicast-dns@7.2.5
├─ nan@2.20.0
├─ napi-thread-safe-callback@0.0.6
├─ negotiator@0.6.3
├─ node-addon-api@4.3.0
├─ node-fetch@2.7.0
├─ node-gyp@10.1.0
├─ node-switchbot@2.1.1
├─ nopt@5.0.0
├─ npmlog@5.0.1
├─ number-allocator@1.0.14
├─ object-assign@4.1.1
├─ object-inspect@1.13.1
├─ object-is@1.1.6
├─ object.assign@4.1.5
├─ p-map@4.0.0
├─ path-is-absolute@1.0.1
├─ path-key@3.1.1
├─ path-scurry@1.11.1
├─ possible-typed-array-names@1.0.0
├─ proc-log@3.0.0
├─ process-nextick-args@2.0.1
├─ promise-retry@2.0.1
├─ pump@3.0.0
├─ qs@6.12.1
├─ readable-stream@3.6.2
├─ regexp.prototype.flags@1.5.2
├─ reinterval@1.1.0
├─ retry@0.12.0
├─ rfdc@1.4.1
├─ rimraf@3.0.2
├─ rxjs@7.8.1
├─ safer-buffer@2.1.2
├─ set-blocking@2.0.0
├─ set-function-length@1.2.2
├─ set-function-name@2.0.2
├─ shebang-command@2.0.0
├─ shebang-regex@3.0.0
├─ signal-exit@4.1.0
├─ smart-buffer@4.2.0
├─ socks-proxy-agent@8.0.3
├─ socks@2.8.3
├─ split2@3.2.2
├─ sprintf-js@1.1.3
├─ stop-iteration-iterator@1.0.0
├─ stream-shift@1.0.3
├─ string_decoder@1.3.0
├─ string-width-cjs@4.2.3
├─ string-width@4.2.3
├─ strip-ansi-cjs@6.0.1
├─ strip-ansi@6.0.1
├─ thunky@1.1.0
├─ tr46@0.0.3
├─ tslib@2.6.3
├─ typedarray@0.0.6
├─ undici@6.19.0
├─ unique-filename@3.0.0
├─ unique-slug@4.0.0
├─ url-template@2.0.8
├─ util-deprecate@1.0.2
├─ uuid@9.0.1
├─ webidl-conversions@3.0.1
├─ whatwg-url@5.0.0
├─ which-boxed-primitive@1.0.2
├─ which-collection@1.0.2
├─ which-typed-array@1.1.15
├─ which@2.0.2
├─ wide-align@1.1.5
├─ wrap-ansi-cjs@7.0.0
├─ wrap-ansi@8.1.0
├─ ws@7.5.9
└─ xtend@4.0.2
Done in 132.20s.

Config for homebridge-switchbot

No response

Screenshots

No response

Device & Model

Hoobs box

Node.js Version

16.19.1

NPM Version

8.19.3

Homebridge Version

1.6.0

Homebridge SwitchBot Plugin Version

3.5.0

Homebridge Config UI X Plugin Version

4.3.0

Operating System

Rasperry PI (Hoobs box)

AndShezar commented 2 weeks ago

Anyone else with this installation error? I reinstalled my hoobs box a few days ago.

donavanbecker commented 2 weeks ago

This plugin isn't developed for HOOBs.

I would recommend moving to homebridge.