Read the statement by Michael Teeuw here.
MMM-KeyBindings install error
-
I’m new to MagicMirror and am having difficulty installing the KeyBindings Module. I’ve been searching the previous posts on the subject, but nothing seems to help. Additionally, I’m new to npm, so I’m having trouble interpreting the error message it spit out. I think the below is telling me there is a dependency issue (ERR! Code 1), and ultimately the error resides with (I think): node:internal/process/task_queues:82:21. Unfortunately, my attempt at researching the error is not turning up anything.
name@raspberrypi:~/MagicMirror/modules/MMM-KeyBindings $ npm install npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs npm WARN deprecated electron-rebuild@3.2.9: Please use @electron/rebuild moving forward. There is no API change, just a package name change npm ERR! code 1 npm ERR! path /home/jlward73/MagicMirror/modules/MMM-KeyBindings/node_modules/lzma-native npm ERR! command failed npm ERR! command sh -c node-gyp-build npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@8.4.1 npm ERR! gyp info using node@20.11.0 | linux | arm64 npm ERR! gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3" npm ERR! gyp http GET https://nodejs.org/download/release/v20.11.0/node-v20.11.0-headers.tar.gz npm ERR! gyp WARN install got an error, rolling back install npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v20.11.0/node-v20.11.0-headers.tar.gz failed, reason: npm ERR! gyp ERR! stack at ClientRequest.<anonymous> (/home/jlward73/MagicMirror/modules/MMM-KeyBindings/node_modules/minipass-fetch/lib/index.js:110:14) npm ERR! gyp ERR! stack at ClientRequest.emit (node:events:518:28) npm ERR! gyp ERR! stack at TLSSocket.socketErrorListener (node:_http_client:495:9) npm ERR! gyp ERR! stack at TLSSocket.emit (node:events:530:35) npm ERR! gyp ERR! stack at emitErrorNT (node:internal/streams/destroy:169:8) npm ERR! gyp ERR! stack at emitErrorCloseNT (node:internal/streams/destroy:128:3) npm ERR! gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:82:21) npm ERR! gyp ERR! System Linux 6.1.0-rpi7-rpi-v8 npm ERR! gyp ERR! command "/usr/bin/node" "/home/jlward73/MagicMirror/modules/MMM-KeyBindings/node_modules/node-gyp/bin/node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd /home/jlward73/MagicMirror/modules/MMM-KeyBindings/node_modules/lzma-native npm ERR! gyp ERR! node -v v20.11.0 npm ERR! gyp ERR! node-gyp -v v8.4.1 npm ERR! gyp ERR! not ok
In addition to getting KeyBindings working, I do want to get better at understanding/troubleshooting issues that come up with npm, so any guidance in either of those areas would be greatly appreciated.
-
@jlward73 this module requires a binary to match the electron version it’s running under.
so the package ‘compiles’ to get the correct binary by using the electron-rebuild tool
installed as part of the module install…but… they have changed the process
electron rebuild must be located in the folder where electron is installed, NOT in the module folderA few other modules have this problem too
if you look at the post install script from the updated pir-sensor
https://github.com/sdetweil/MMM-PIR-Sensoryou can see how it does that
MM does NOT ship this tool (which also changed package name)
so the script checks to see if it’s installed, if not then install it, then use itI am traveling today