OpenWonderLabs / homebridge-switchbot

The Homebridge SwitchBot plugin allows you to access your SwitchBot Device(s) from HomeKit. Homebridge.
https://openwonderlabs.github.io/homebridge-switchbot/
ISC License
243 stars 53 forks source link

"Cannot find package node-switchbot" after update #1032

Closed fancypantsifier closed 1 month ago

fancypantsifier commented 2 months ago

I'm stuck on the cannot find node-switchbot error from a stale/closed issue as well:

[8/24/2024, 9:37:02 PM] ====================
[8/24/2024, 9:37:02 PM] ERROR LOADING PLUGIN @switchbot/homebridge-switchbot:
[8/24/2024, 9:37:02 PM] Error: Cannot find package 'node-switchbot' imported from /volume2/homebridge/node_modules/@switchbot/homebridge-switchbot/dist/platform.js
    at new NodeError (node:internal/errors:406:5)
    at packageResolve (node:internal/modules/esm/resolve:789:9)
    at moduleResolve (node:internal/modules/esm/resolve:838:20)
    at defaultResolve (node:internal/modules/esm/resolve:1043:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:228:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
    at link (node:internal/modules/esm/module_job:84:36)

I've tried versions 3.5.0 through the current 3.7.1-beta.11. I see errors about not being able to find make during install, which I've also seen reported in other Issues. I'm running on a Synology NAS with the latest Homebridge and Node v20.9.0. Everything was fine until I tried to update to a new version of the plugin, but now I cannot seem to get back to a good state.

Originally posted by @fancypantsifier in https://github.com/OpenWonderLabs/homebridge-switchbot/issues/999#issuecomment-2308652523

fancypantsifier commented 2 months ago

Oh interesting, I just tried 3.4.0 and it's working again. I thought I had started with 3.5.0 before things went awry, but I guess I was wrong. Regardless, it seems like something in the 3.4 -> 3.5+ upgrade broke something for me.

fmottaz commented 2 months ago

Same issue and same base configuration for me (Synology, Node 20.9.0). As I downloaded version 3.7 for the first time and then tried 3.7.1b, I have not tried to get to a lower version. Will try 3.4 now.

quentinhayot commented 1 month ago

I have the same issue. Any version >= 3.5 will make all my accessories disappear. They'll come back as soon as I rollback to 3.4

donavanbecker commented 1 month ago

Can you try the latest beta:

npm version

Click here to find out how to install Beta

donavanbecker commented 1 month ago

node-switchbot is now a required dependency in 3.8.0