MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-KeyBindings install error

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    4 Posts 3 Posters 381 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      jlward73
      last edited by

      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.

      S 1 Reply Last reply Reply Quote 0
      • S Away
        sdetweil @jlward73
        last edited by

        @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 folder

        A 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-Sensor

        you 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 it

        I am traveling today

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        L 1 Reply Last reply Reply Quote 0
        • L Offline
          lovedatsnow @sdetweil
          last edited by

          @jlward73 I ran into this same problem.

          Workaround I used was to run the preinstall script manually in the MMM-KeyBindings directory. The preinstall script successfully installed the required libudev-dev package. Afterwards, the npm install ran without problems (other than the warnings about deprecated modules you mention).

          Also worth noting, that the install steps say “If you are not planning to use this module with anything but a standard keyboard. STOP HERE.”, but you still need to run the npm install step if you’re using just the standard keyboard.

          S 1 Reply Last reply Reply Quote 0
          • S Away
            sdetweil @lovedatsnow
            last edited by

            @lovedatsnow you should post this as an issue to the module github page

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Enjoying MagicMirror? Please consider a donation!
            MagicMirror created by Michael Teeuw.
            Forum managed by Sam, technical setup by Karsten.
            This forum is using NodeBB as its core | Contributors
            Contact | Privacy Policy