hannseman / homebridge-mi-hygrothermograph

Homebridge plugin for the Xiaomi Mi Bluetooth Temperature and Humidity Sensor
MIT License
264 stars 52 forks source link

compiled against a different Node.js version using #170

Closed Funskes closed 2 years ago

Funskes commented 2 years ago

Expected Behavior

Working just normal

Current Behavior

I get an error after updating Node.js and a restart: [16/12/2021, 11:03:59] ==================== [16/12/2021, 11:03:59] ERROR INITIALIZING PLUGIN homebridge-mi-hygrothermograph: [16/12/2021, 11:03:59] Error: The module '/usr/local/lib/node_modules/homebridge-mi-hygrothermograph/node_modules/@abandonware/bluetooth-hci-socket/lib/binding/bluetooth_hci_socket.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 83. This version of Node.js requires NODE_MODULE_VERSION 93. Please try re-compiling or re-installing the module (for instance, using npm rebuild or npm install). at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object. (/usr/local/lib/node_modules/homebridge-mi-hygrothermograph/node_modules/@abandonware/bluetooth-hci-socket/lib/native.js:6:15) at Module._compile (node:internal/modules/cjs/loader:1101:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) [16/12/2021, 11:03:59] ==================== [16/12/2021, 11:03:59] ---

Versions

hannseman commented 2 years ago

Hi! As described in the error message the installed version of this plugin was compiled against an older node version and you need to reinstall it. The easiest way in my experience is just to remove the homebridge-mi-hygrothermograph directory and then install the latest version, i.e:

rm -rf /usr/local/lib/node_modules/homebridge-mi-hygrothermograph/
npm install -g homebridge-mi-hygrothermograph

Also see: https://github.com/hannseman/homebridge-mi-hygrothermograph/issues/124

Funskes commented 2 years ago

Thanks!!!! It's working again! πŸ™πŸΌπŸ‘