Node-red-contrib-speakerpi fails to install

I tried to install this, but it constantly fails.
I have two Raspbery PI boards: RPi 1.1 and RPi 3b
For the RPi1.1 I used the following OS'es

  • Raspberry Pi OS Lite 32 bit Bullseye 2022-09-22
  • Raspberry Pi OS Full 32 Bullseye 2022-09-22

and with the RPi 3b I tried

  • Raspberry Pi OS Full 64 bit Bullseye 2022-09-22
  • Openhabian 3.4.1

Every single time I try to instsall speakerpi from the "Manage palette" window or from shell ./node-red -folder I get a bunch load of error messages. This has happened every single time with all of the RPi's and OS's I've tried. I'm believe I have installed all dependencies.

Error messages:

2023-01-13T14:17:36.402Z Install : node-red-contrib-speakerpi 0.0.43

2023-01-13T14:17:36.472Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-speakerpi@0.0.43
2023-01-13T14:17:38.438Z [err] npm
2023-01-13T14:17:38.440Z [err]  WARN
2023-01-13T14:17:38.440Z [err]  config production Use `--omit=dev` instead.
2023-01-13T14:17:45.991Z [err] npm
2023-01-13T14:17:45.992Z [err]  ERR! 
2023-01-13T14:17:45.993Z [err] code
2023-01-13T14:17:45.993Z [err]  1
2023-01-13T14:17:45.994Z [err] npm ERR!
2023-01-13T14:17:45.994Z [err]  path /home/openhabian/.node-red/node_modules/speaker
2023-01-13T14:17:46.002Z [err] npm ERR!
2023-01-13T14:17:46.002Z [err]  command failed
2023-01-13T14:17:46.002Z [err] npm ERR!
2023-01-13T14:17:46.002Z [err]  
2023-01-13T14:17:46.003Z [err] command sh -c -- node-gyp rebuild
2023-01-13T14:17:46.004Z [err] npm ERR!
2023-01-13T14:17:46.004Z [err]  gyp info it worked if it ends with ok
2023-01-13T14:17:46.004Z [err] npm ERR! gyp info using node-gyp@9.1.0
2023-01-13T14:17:46.004Z [err] npm ERR! gyp info using node@16.19.0 | linux | arm64
2023-01-13T14:17:46.004Z [err] npm 
2023-01-13T14:17:46.005Z [err] ERR! gyp info find Python using Python version 3.9.2 found at "/usr/bin/python3"
2023-01-13T14:17:46.005Z [err] npm ERR!
2023-01-13T14:17:46.005Z [err]  gyp info spawn /usr/bin/python3
2023-01-13T14:17:46.005Z [err] npm ERR!
2023-01-13T14:17:46.005Z [err]  gyp info spawn args [
2023-01-13T14:17:46.005Z [err] npm ERR! gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
2023-01-13T14:17:46.005Z [err] npm
2023-01-13T14:17:46.005Z [err]  ERR! gyp info spawn args   'binding.gyp',
2023-01-13T14:17:46.005Z [err] npm ERR!
2023-01-13T14:17:46.005Z [err]  gyp info spawn args   '-f',
2023-01-13T14:17:46.005Z [err] npm ERR!
2023-01-13T14:17:46.006Z [err]  gyp info spawn args   'make',
2023-01-13T14:17:46.006Z [err] npm ERR! gyp info spawn args   '-I',
2023-01-13T14:17:46.006Z [err] npm
2023-01-13T14:17:46.006Z [err]  ERR! gyp info spawn args   '/home/openhabian/.node-red/node_modules/speaker/build/config.gypi',
2023-01-13T14:17:46.006Z [err] npm ERR!
2023-01-13T14:17:46.006Z [err]  gyp info spawn args   '-I',
2023-01-13T14:17:46.006Z [err] npm ERR! gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
2023-01-13T14:17:46.006Z [err] npm ERR! gyp info spawn args   '-I',
2023-01-13T14:17:46.006Z [err] npm
2023-01-13T14:17:46.006Z [err]  ERR! gyp info spawn args   '/home/openhabian/.cache/node-gyp/16.19.0/include/node/common.gypi',
2023-01-13T14:17:46.006Z [err] npm 
2023-01-13T14:17:46.007Z [err] ERR! gyp info spawn args   '-Dlibrary=shared_library',
2023-01-13T14:17:46.007Z [err] npm ERR!
2023-01-13T14:17:46.007Z [err]  gyp info spawn args   '-Dvisibility=default',
2023-01-13T14:17:46.007Z [err] npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/openhabian/.cache/node-gyp/16.19.0',
2023-01-13T14:17:46.007Z [err] npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
2023-01-13T14:17:46.007Z [err] npm
2023-01-13T14:17:46.007Z [err]  ERR! gyp info spawn args   '-Dnode_lib_file=/home/openhabian/.cache/node-gyp/16.19.0/<(target_arch)/node.lib',
2023-01-13T14:17:46.007Z [err] npm ERR!
2023-01-13T14:17:46.007Z [err]  gyp info spawn args   '-Dmodule_root_dir=/home/openhabian/.node-red/node_modules/speaker',
2023-01-13T14:17:46.007Z [err] npm ERR! gyp info spawn args   '-Dnode_engine=v8',
2023-01-13T14:17:46.007Z [err] npm ERR!
2023-01-13T14:17:46.008Z [err]  gyp info spawn args   '--depth=.',
2023-01-13T14:17:46.008Z [err] npm ERR! gyp info spawn args   '--no-parallel',
2023-01-13T14:17:46.008Z [err] npm ERR! gyp info spawn args   '--generator-output',
2023-01-13T14:17:46.008Z [err] npm 
2023-01-13T14:17:46.008Z [err] ERR! gyp info spawn args   'build',
2023-01-13T14:17:46.008Z [err] npm ERR!
2023-01-13T14:17:46.008Z [err]  gyp info spawn args   '-Goutput_dir=.'
2023-01-13T14:17:46.008Z [err] npm ERR!
2023-01-13T14:17:46.008Z [err]  gyp info spawn args ]
2023-01-13T14:17:46.008Z [err] npm ERR! gyp: name 'mpg123_cpu' is not defined while evaluating condition 'mpg123_cpu=="arm_nofpu"' in deps/mpg123/mpg123.gyp while loading dependencies of binding.gyp while trying to load binding.gyp
2023-01-13T14:17:46.009Z [err] npm ERR! gyp ERR! configure error 
2023-01-13T14:17:46.009Z [err] npm 
2023-01-13T14:17:46.009Z [err] ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
2023-01-13T14:17:46.009Z [err] npm ERR!
2023-01-13T14:17:46.009Z [err]  gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:284:16)
2023-01-13T14:17:46.009Z [err] npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
2023-01-13T14:17:46.009Z [err] npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
2023-01-13T14:17:46.009Z [err] npm
2023-01-13T14:17:46.009Z [err]  ERR! gyp ERR! System Linux 5.15.84-v8+
2023-01-13T14:17:46.009Z [err] npm 
2023-01-13T14:17:46.009Z [err] ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2023-01-13T14:17:46.009Z [err] npm ERR!
2023-01-13T14:17:46.010Z [err]  gyp ERR! cwd /home/openhabian/.node-red/node_modules/speaker
2023-01-13T14:17:46.010Z [err] npm ERR!
2023-01-13T14:17:46.010Z [err]  gyp ERR! node -v v16.19.0
2023-01-13T14:17:46.010Z [err] npm ERR! gyp ERR! node-gyp -v v9.1.0
2023-01-13T14:17:46.010Z [err] npm ERR! gyp ERR! not ok
2023-01-13T14:17:46.019Z [err] 
2023-01-13T14:17:46.020Z [err] npm ERR!
2023-01-13T14:17:46.020Z [err]  A complete log of this run can be found in:
2023-01-13T14:17:46.020Z [err] npm ERR!     /home/openhabian/.npm/_logs/2023-01-13T14_17_38_272Z-debug-0.log
2023-01-13T14:17:46.053Z rc=1

Did you install pre-requisites

Additionally you have to install on the Raspberry Pi

    sudo apt-get install libasound2-dev

Yes, I did install libasound2-dev as instructed before trying to install the speakerpi.

then you will have to read through the issues on node-red-contrib-speakerpi and the underlying speaker package where you will find several users with the exact same issue - may be some clues in there.

search for mpg123_cpu

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.