tbouron / MMM-FlightTracker

MagicMirror module that uses ADS-B systems to track nearby planes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upgrading to MM 2.16: "The module was compiled against a different Node.js version" issue

gabrielmc9 opened this issue · comments

commented

Hello,

Thanks for the great module. I use it to display nearby flight data collected from PiAware. Upon upgrading to MM 2.16 I was greeted with a "module compiled against a different node.js" error, specifically referencing MMM-FlightTracker. MM would not load - just a black screen. I tried the customary fixes (npm install, npm rebuild, re-installing the module from scratch, etc). Upon a rebuild or re-install of the module, I get an error I've never seen before: "Could not detect abi for version 11.4.9 and runtime electron. Updating "node-abi" might help solve this issue if it is a new release of electron."

Error logs are included below. I'm happy to provide more details if that would be helpful. The last known version this module worked with is MM 2.14.

Many thanks...

PM2 Error Log

[26.08.2021 18:02.06.261] [ERROR] Whoops! There was an uncaught exception...
[26.08.2021 18:02.06.263] [ERROR] TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at Class.stop (/home/pi/MagicMirror/modules/MMM-Remote-Control/node_helper.js:71:20)
at App.stop (/home/pi/MagicMirror/js/app.js:253:16)
at App.<anonymous> (/home/pi/MagicMirror/js/electron.js:129:7)
at App.emit (events.js:315:20)
[26.08.2021 18:02.06.265] [ERROR] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
[26.08.2021 18:02.06.265] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
[26.08.2021 18:02.14.362] [ERROR] WARNING! Could not load config file. Starting with default configuration. Error found: Error: The module '/home/pi/MagicMirror/modules/MMM-FlightTracker/node_modules/rtl-sdr/build/Release/rtlsdr.node' was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 85. Please try re-compiling or re-installing the module (for instance, using `npm rebuild` or `npm install`).
[26.08.2021 18:02.14.381] [ERROR] App threw an error during load
[26.08.2021 18:02.14.383] [ERROR] Error: Module did not self-register: '/home/pi/MagicMirror/modules/MMM-FlightTracker/node_modules/rtl-sdr/build/Release/rtlsdr.node'.
at process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1812)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1203:18)
at Object.func [as .node] (electron/js2c/asar_bundle.js:5:1812)
at Module.load (internal/modules/cjs/loader.js:992:32)
at Module._load (internal/modules/cjs/loader.js:885:14)
at Function.f._load (electron/js2c/asar_bundle.js:5:12633)
at Module.require (internal/modules/cjs/loader.js:1032:19)
at require (internal/modules/cjs/helpers.js:72:18)
at bindings (/home/pi/MagicMirror/modules/MMM-FlightTracker/node_modules/bindings/bindings.js:112:48)
at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-FlightTracker/node_modules/rtl-sdr/index.js:3:35)

Error messages resulting from 'npm i' in the MMM-FlightTracker directory

pi@magicmirror1:~/MagicMirror/modules/MMM-FlightTracker $ npm i

> rtl-sdr@git+https://github.com/tbouron/rtl-sdr.git#ed19ec936b59a3811693e34f1979124fe5fd6731 install /home/pi/MagicMirror/modules/MMM-FlightTracker/node_modules/rtl-sdr
> node-gyp rebuild

make: Entering directory '/home/pi/MagicMirror/modules/MMM-FlightTracker/node_modules/rtl-sdr/build' CXX(target) Release/obj.target/rtlsdr/src/binding.o
In file included from ../src/binding.cc:1: ../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’: ../../nan/nan.h:2298:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type] , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
^
In file included from ../../nan/nan.h:54,
from ../src/binding.cc:1:
../src/binding.cc: At global scope: /home/pi/.cache/node-gyp/10.21.0/include/node/node.h:573:43: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type] (node::addon_register_func) (regfunc), \
^
/home/pi/.cache/node-gyp/10.21.0/include/node/node.h:607:3: note: in expansion of macro ‘NODE_MODULE_X’
NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
^~~~~~~~~~~~~
../src/binding.cc:319:1: note: in expansion of macro ‘NODE_MODULE’
NODE_MODULE(rtlsdr, Init)
^~~~~~~~~~~
In file included from /home/pi/.cache/node-gyp/10.21.0/include/node/node.h:63,
from ../../nan/nan.h:54,
from ../src/binding.cc:1:
/home/pi/.cache/node-gyp/10.21.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’: /home/pi/.cache/node-gyp/10.21.0/include/node/node_object_wrap.h:84:78: required from here /home/pi/.cache/node-gyp/10.21.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type] reinterpret_cast<Callback>(callback), type);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/.cache/node-gyp/10.21.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’: ../../nan/nan_object_wrap.h:65:61: required from here /home/pi/.cache/node-gyp/10.21.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type] SOLINK_MODULE(target) Release/obj.target/rtlsdr.node COPY Release/rtlsdr.node make: Leaving directory '/home/pi/MagicMirror/modules/MMM-FlightTracker/node_modules/rtl-sdr/build'

> MMM-FlightTracker@1.2.1 postinstall /home/pi/MagicMirror/modules/MMM-FlightTracker
> npx electron-rebuild

⠋ Searching dependency tree
An unhandled error occurred inside electron-rebuild
Could not detect abi for version 11.4.9 and runtime electron. Updating "node-abi" might help solve this issue if it is a new release of electron

Error: Could not detect abi for version 11.4.9 and runtime electron. Updating "node-abi" might help solve this issue if it is a new release of electron
at Object.getAbi (/home/pi/MagicMirror/modules/MMM-FlightTracker/node_modules/node-abi/index.js:30:9)
at new Rebuilder (/home/pi/MagicMirror/modules/MMM-FlightTracker/node_modules/electron-rebuild/lib/src/rebuild.js:122:28)
at rebuildWithOptions (/home/pi/MagicMirror/modules/MMM-FlightTracker/node_modules/electron-rebuild/lib/src/rebuild.js:393:23)
at Object.doRebuild [as rebuild] (/home/pi/MagicMirror/modules/MMM-FlightTracker/node_modules/electron-rebuild/lib/src/rebuild.js:400:16)
at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-FlightTracker/node_modules/electron-rebuild/lib/src/cli.js:115:33)
at Generator.next (<anonymous>)
at fulfilled (/home/pi/MagicMirror/modules/MMM-FlightTracker/node_modules/electron-rebuild/lib/src/cli.js:5:58)
npm ERR! code ELIFECYCLE
npm ERR! errno 255
npm ERR! MMM-FlightTracker@1.2.1 postinstall: `npx electron-rebuild
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the MMM-FlightTracker@1.2.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2021-08-26T21_58_46_092Z-debug.log

I'll confess to not fully understanding what's going on with this... but here's how I managed to 'solve' it:

cd modules/MMM-FlightTracker
npm i magicmirror-rebuild
./node_modules/.bin/MagicMirror-rebuild

This seems to resolve the problem and allows my MagicMirror to start up, but does break any time I do an upgrade. As and when I get chance, I'll try digging in to the actual cause of the problem.

commented

@mattdy - Just wanted to thank you for your response. I've got my hands full with non-MMM activities right now but will try this once I get a moment.