HomeAssistant palette installation error

Dear, please help,
I cannot install palette to NR at HA os running RaspberryPi.
Im new and no idea how handle this error.

here is the log:


-----------------------------------------------------------
2022-08-30T22:06:30.620Z Install : node-red-contrib-lgtv 1.1.0

2022-08-30T22:06:29.899Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-lgtv@1.1.0
2022-08-30T22:06:34.652Z [err] npm
2022-08-30T22:06:34.655Z [err]  WARN config production Use `--omit=dev` instead.
2022-08-30T22:06:52.538Z [err] npm
2022-08-30T22:06:52.539Z [err]  ERR! code 1
2022-08-30T22:06:52.540Z [err] npm ERR!
2022-08-30T22:06:52.541Z [err]  path /config/node-red/node_modules/bufferutil
2022-08-30T22:06:52.552Z [err] npm ERR! command failed
2022-08-30T22:06:52.552Z [err] npm ERR! command sh -c node-gyp-build
2022-08-30T22:06:52.554Z [err] npm ERR! gyp info it worked if it ends with ok
2022-08-30T22:06:52.554Z [err] npm ERR!
2022-08-30T22:06:52.556Z [err]  gyp info using node-gyp@9.0.0
2022-08-30T22:06:52.556Z [err] npm ERR! gyp info using node@16.16.0 | linux | arm64
2022-08-30T22:06:52.556Z [err] npm ERR! gyp ERR! find Python 
2022-08-30T22:06:52.556Z [err] npm ERR! gyp ERR! find Python checking Python explicitly set from command line or npm configuration
2022-08-30T22:06:52.556Z [err] npm ERR! gyp ERR! find Python - "--python=" or "npm config get python" is "/usr/bin/python3"
2022-08-30T22:06:52.556Z [err] npm ERR! gyp ERR! find Python - "/usr/bin/python3" is not in PATH or produced an error
2022-08-30T22:06:52.556Z [err] npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
2022-08-30T22:06:52.557Z [err] npm ERR! gyp ERR! find Python checking if "python3" can be used
2022-08-30T22:06:52.557Z [err] npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
2022-08-30T22:06:52.557Z [err] npm ERR! gyp ERR! find Python checking if "python" can be used
2022-08-30T22:06:52.557Z [err] npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
2022-08-30T22:06:52.557Z [err] npm ERR! gyp ERR! find Python 
2022-08-30T22:06:52.558Z [err] npm ERR! gyp ERR! find Python **********************************************************
2022-08-30T22:06:52.558Z [err] npm ERR! gyp ERR! find Python You need to install the latest version of Python.
2022-08-30T22:06:52.558Z [err] npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
2022-08-30T22:06:52.558Z [err] npm ERR!
2022-08-30T22:06:52.558Z [err]  gyp ERR! find Python you can try one of the following options:
2022-08-30T22:06:52.558Z [err] npm ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
2022-08-30T22:06:52.558Z [err] npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
2022-08-30T22:06:52.558Z [err] npm 
2022-08-30T22:06:52.559Z [err] ERR! gyp ERR! find Python - Set the environment variable PYTHON
2022-08-30T22:06:52.559Z [err] npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
2022-08-30T22:06:52.559Z [err] npm ERR!
2022-08-30T22:06:52.559Z [err]  gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
2022-08-30T22:06:52.559Z [err] npm ERR! gyp ERR! find Python For more information consult the documentation at:
2022-08-30T22:06:52.559Z [err] npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
2022-08-30T22:06:52.559Z [err] npm
2022-08-30T22:06:52.560Z [err]  ERR! gyp ERR! find Python **********************************************************
2022-08-30T22:06:52.560Z [err] npm ERR! gyp ERR! find Python 
2022-08-30T22:06:52.560Z [err] npm 
2022-08-30T22:06:52.560Z [err] ERR! gyp ERR! configure error 
2022-08-30T22:06:52.560Z [err] npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
2022-08-30T22:06:52.560Z [err] npm ERR! gyp ERR! stack     at PythonFinder.fail (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:330:47)
2022-08-30T22:06:52.561Z [err] npm ERR! gyp ERR! stack     at PythonFinder.runChecks (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:159:21)
2022-08-30T22:06:52.561Z [err] npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:202:16)
2022-08-30T22:06:52.561Z [err] npm 
2022-08-30T22:06:52.561Z [err] ERR! gyp ERR! stack     at PythonFinder.execFileCallback (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:294:16)
2022-08-30T22:06:52.561Z [err] npm ERR! gyp ERR! stack     at exithandler (node:child_process:406:5)
2022-08-30T22:06:52.561Z [err] npm ERR! gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:418:5)
2022-08-30T22:06:52.562Z [err] npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
2022-08-30T22:06:52.562Z [err] npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
2022-08-30T22:06:52.562Z [err] npm 
2022-08-30T22:06:52.562Z [err] ERR! gyp ERR! stack     at onErrorNT (node:internal/child_process:478:16)
2022-08-30T22:06:52.562Z [err] npm ERR! gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
2022-08-30T22:06:52.562Z [err] npm ERR!
2022-08-30T22:06:52.563Z [err]  gyp ERR! System Linux 5.15.32-v8
2022-08-30T22:06:52.563Z [err] npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2022-08-30T22:06:52.563Z [err] npm ERR! gyp ERR! cwd /config/node-red/node_modules/bufferutil
2022-08-30T22:06:52.563Z [err] npm 
2022-08-30T22:06:52.563Z [err] ERR! gyp ERR! node -v v16.16.0
2022-08-30T22:06:52.563Z [err] npm ERR! gyp ERR! node-gyp -v v9.0.0
2022-08-30T22:06:52.563Z [err] npm ERR!
2022-08-30T22:06:52.564Z [err]  gyp ERR! not ok
2022-08-30T22:06:52.576Z [err] 
2022-08-30T22:06:52.578Z [err] npm ERR!
2022-08-30T22:06:52.578Z [err]  A complete log of this run can be found in:
2022-08-30T22:06:52.578Z [err] npm ERR!     /root/.npm/_logs/2022-08-30T22_06_34_403Z-debug-0.log
2022-08-30T22:06:52.632Z rc=1

It seems to be saying it can't find Python.

I don't know if Python is available in Home Assistant.
Maybe this is something to raise in the HA forum?

But it might be worth trying at the command line npm config set python $(which python) and then try again to install the palette node[s].

Pretty sure this is to do with NR 3.02 and Python 3 - i remember seeing something on this forum recently by the maintainer of the docker image and a proposed work around inside the image to do a link of the python executables to overcome it.

Craig

no idea, where to write this sentence.
Anyway, thanks for answer.

If you don't understand what the command line is, probably you should do a bit of background reading on Linux. If not for this issue since @craigcurtin has pointed you to a possible work-around, it will be a sound investment.

there is only add-on terminal. Do exist any other? How to run?
just type npm return error, cause it doesnt know it. Where should be located?


Nope as you are running Node Red in a Container under Home Assistant your best bet is through (HACS) install portainer into Home Assistant.

THis will then allow you to easily get a command line interface in the docker container that houses Node Red

Craig

Oh good grief, is that what Home Assistant looks like? :upside_down_face:
I'm completely out of my depth here. Give me RPiOS Lite any day!

Sorry @agino it's clear I can offer nothing more than my original suggestion of the HA forum.
But @craigcurtin seems to know what he's talking about.

Yep thats just the front end editor menu rather than Dashboards etc created in it.

Craig

I did install HACS.

what next?

From within HACS you should be able to find Portainer and then install that - this will then let you see the containers you are running in HASSos - once you have done this you highligh the NR container and there is an option to open a console

Craig

hmm, no idea what next. there is no portainer. only monitor docker, but i dont know even how to start it and what to look for.

The real problem here is that the node-red-contrib-lgtv is broken and needs fixing.

Either it or more likely one of it's dependencies (bufferutil) needs updating to use python3.

So even if you do manage to get this to work you should raise and issue against that node.

p.s. Also running npm config set python $(which python) will not work as there is NO python binary anymore in the container, only python3

OK you have two paths here - you can either read up on Docker and how to get a console into a Docker container - or do some searching on how to install Portainer in Home Assistant to enable management of Docker containers.

Craig

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