hobbyquaker / node-red-contrib-lgtv

Node-RED Nodes to control LG webOS Smart TVs :tv:
http://flows.nodered.org/node/node-red-contrib-lgtv
MIT License
59 stars 22 forks source link

Error installing through Node-RED addon on Home Assistant OS #62

Open l1ttled3vil opened 6 months ago

l1ttled3vil commented 6 months ago

I'm having issues installing this in Node-RED, which is running as an add-on through the Home Assistant OS. I've used this palette many times in Node-RED installed standalone on the RPI-OS without issue, this is the first time trying to run it through HA. The log file suggests an issue with python, but I'm not sure how to fix this. Where would I enter the fix(es) suggested in the log file (copied below)? Straight into the terminal command line or somewhere in the Node-RED configuration?

Version: core-2024.1.3 Installation Type: Home Assistant OS Python Version: 3.11.6 Operating System Version: 6.1.63-haos-raspi Supervisor Version: supervisor-2023.12.1

`2024-01-20T23:29:34.539Z Install : node-red-contrib-lgtv 1.1.0

2024-01-20T23:29:34.559Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-lgtv@1.1.0 2024-01-20T23:29:35.805Z [err] npm 2024-01-20T23:29:35.806Z [err] WARN config 2024-01-20T23:29:35.806Z [err] production Use --omit=dev instead. 2024-01-20T23:29:48.220Z [err] npm 2024-01-20T23:29:48.220Z [err] ERR! code 1 2024-01-20T23:29:48.221Z [err] npm ERR! 2024-01-20T23:29:48.221Z [err] path /config/node_modules/utf-8-validate 2024-01-20T23:29:48.227Z [err] npm ERR! command failed 2024-01-20T23:29:48.227Z [err] npm ERR! command sh -c node-gyp-build 2024-01-20T23:29:48.227Z [err] npm 2024-01-20T23:29:48.228Z [err] ERR! gyp info it worked if it ends with ok 2024-01-20T23:29:48.228Z [err] npm ERR! gyp info using node-gyp@10.0.1 2024-01-20T23:29:48.228Z [err] npm ERR! gyp info using node@18.19.0 | linux | arm64 2024-01-20T23:29:48.228Z [err] npm ERR! gyp ERR! find Python 2024-01-20T23:29:48.228Z [err] npm ERR! 2024-01-20T23:29:48.229Z [err] gyp ERR! find Python Python is not set from command line or npm configuration 2024-01-20T23:29:48.229Z [err] npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON 2024-01-20T23:29:48.229Z [err] npm 2024-01-20T23:29:48.230Z [err] ERR! gyp ERR! find Python checking if "python3" can be used 2024-01-20T23:29:48.230Z [err] npm ERR! gyp ERR! find Python - executable path is "" 2024-01-20T23:29:48.230Z [err] npm ERR! gyp ERR! find Python - "" could not be run 2024-01-20T23:29:48.230Z [err] npm ERR! gyp ERR! find Python checking if "python" can be used 2024-01-20T23:29:48.230Z [err] npm ERR! gyp ERR! find Python - executable path is "" 2024-01-20T23:29:48.230Z [err] npm 2024-01-20T23:29:48.230Z [err] ERR! gyp ERR! find Python - "" could not be run 2024-01-20T23:29:48.230Z [err] npm ERR! gyp ERR! find Python 2024-01-20T23:29:48.230Z [err] npm ERR! gyp ERR! find Python ** 2024-01-20T23:29:48.230Z [err] npm ERR! gyp ERR! find Python You need to install the latest version of Python. 2024-01-20T23:29:48.230Z [err] npm ERR! 2024-01-20T23:29:48.231Z [err] gyp ERR! find Python Node-gyp should be able to find and use Python. If not, 2024-01-20T23:29:48.231Z [err] npm ERR! gyp ERR! find Python you can try one of the following options: 2024-01-20T23:29:48.231Z [err] npm ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable" 2024-01-20T23:29:48.231Z [err] npm ERR! gyp ERR! find Python (accepted by both node-gyp and npm) 2024-01-20T23:29:48.231Z [err] npm ERR! gyp ERR! find Python - Set the environment variable PYTHON 2024-01-20T23:29:48.231Z [err] npm 2024-01-20T23:29:48.231Z [err] ERR! gyp ERR! find Python - Set the npm configuration variable python: 2024-01-20T23:29:48.231Z [err] npm ERR! gyp ERR! find Python npm config set python "/path/to/pythonexecutable" 2024-01-20T23:29:48.231Z [err] npm ERR! 2024-01-20T23:29:48.231Z [err] gyp ERR! find Python For more information consult the documentation at: 2024-01-20T23:29:48.231Z [err] npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation 2024-01-20T23:29:48.231Z [err] npm ERR! gyp ERR! find Python ** 2024-01-20T23:29:48.232Z [err] npm ERR! gyp ERR! find Python 2024-01-20T23:29:48.232Z [err] npm ERR! gyp ERR! configure error 2024-01-20T23:29:48.232Z [err] npm ERR! 2024-01-20T23:29:48.232Z [err] gyp ERR! stack Error: Could not find any Python installation to use 2024-01-20T23:29:48.232Z [err] npm ERR! gyp ERR! stack at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:306:11) 2024-01-20T23:29:48.232Z [err] npm ERR! gyp ERR! stack at PythonFinder.findPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:164:17) 2024-01-20T23:29:48.232Z [err] npm ERR! gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 2024-01-20T23:29:48.232Z [err] npm ERR! gyp ERR! stack at async configure (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:23:18) 2024-01-20T23:29:48.232Z [err] npm 2024-01-20T23:29:48.232Z [err] ERR! gyp ERR! stack at async run (/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js:81:18) 2024-01-20T23:29:48.232Z [err] npm ERR! gyp ERR! System Linux 6.1.63-haos-raspi 2024-01-20T23:29:48.232Z [err] npm ERR! 2024-01-20T23:29:48.232Z [err] gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 2024-01-20T23:29:48.232Z [err] npm ERR! gyp ERR! cwd /config/node_modules/utf-8-validate 2024-01-20T23:29:48.232Z [err] npm ERR! 2024-01-20T23:29:48.233Z [err] gyp ERR! node -v v18.19.0 2024-01-20T23:29:48.233Z [err] npm ERR! gyp ERR! node-gyp -v v10.0.1 2024-01-20T23:29:48.233Z [err] npm ERR! 2024-01-20T23:29:48.233Z [err] gyp ERR! not ok`

jeremyharris246 commented 5 months ago

I'm also getting a very similar issue when attempting to install on Home Assistant OS

2024-02-07T17:10:58.751Z Install : node-red-contrib-lgtv 1.1.0

2024-02-07T17:10:59.587Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-lgtv@1.1.0 2024-02-07T17:11:01.346Z [err] npm 2024-02-07T17:11:01.347Z [err] WARN config 2024-02-07T17:11:01.347Z [err] production Use --omit=dev instead. 2024-02-07T17:11:09.794Z [err] npm 2024-02-07T17:11:09.795Z [err] ERR! code 1 2024-02-07T17:11:09.795Z [err] npm ERR! 2024-02-07T17:11:09.795Z [err] path /config/node_modules/bufferutil 2024-02-07T17:11:09.801Z [err] npm ERR! 2024-02-07T17:11:09.802Z [err] command failed 2024-02-07T17:11:09.802Z [err] npm ERR! 2024-02-07T17:11:09.802Z [err] command sh -c node-gyp-build 2024-02-07T17:11:09.802Z [err] npm ERR! 2024-02-07T17:11:09.802Z [err] gyp info it worked if it ends with ok 2024-02-07T17:11:09.802Z [err] npm ERR! gyp info using node-gyp@10.0.1 2024-02-07T17:11:09.802Z [err] npm ERR! gyp info using node@18.19.0 | linux | arm64 2024-02-07T17:11:09.802Z [err] npm ERR! gyp ERR! find Python 2024-02-07T17:11:09.803Z [err] npm ERR! 2024-02-07T17:11:09.804Z [err] gyp ERR! find Python Python is not set from command line or npm configuration 2024-02-07T17:11:09.804Z [err] npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON 2024-02-07T17:11:09.804Z [err] npm ERR! gyp ERR! find Python checking if "python3" can be used 2024-02-07T17:11:09.804Z [err] npm ERR! 2024-02-07T17:11:09.804Z [err] gyp ERR! find Python - executable path is "" 2024-02-07T17:11:09.804Z [err] npm ERR! gyp ERR! find Python - "" could not be run 2024-02-07T17:11:09.804Z [err] npm ERR! gyp ERR! find Python checking if "python" can be used 2024-02-07T17:11:09.804Z [err] npm ERR! gyp ERR! find Python - executable path is "" 2024-02-07T17:11:09.804Z [err] npm ERR! gyp ERR! find Python - "" could not be run 2024-02-07T17:11:09.804Z [err] npm ERR! gyp ERR! find Python 2024-02-07T17:11:09.804Z [err] npm ERR! gyp ERR! find Python ** 2024-02-07T17:11:09.804Z [err] npm ERR! gyp ERR! find Python You need to install the latest version of Python. 2024-02-07T17:11:09.804Z [err] npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not, 2024-02-07T17:11:09.805Z [err] npm ERR! gyp ERR! find Python you can try one of the following options: 2024-02-07T17:11:09.805Z [err] npm 2024-02-07T17:11:09.805Z [err] ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable" 2024-02-07T17:11:09.805Z [err] npm ERR! gyp ERR! find Python (accepted by both node-gyp and npm) 2024-02-07T17:11:09.805Z [err] npm ERR! 2024-02-07T17:11:09.806Z [err] gyp ERR! find Python - Set the environment variable PYTHON 2024-02-07T17:11:09.806Z [err] npm ERR! gyp ERR! find Python - Set the npm configuration variable python: 2024-02-07T17:11:09.806Z [err] npm ERR! 2024-02-07T17:11:09.806Z [err] gyp ERR! find Python npm config set python "/path/to/pythonexecutable" 2024-02-07T17:11:09.806Z [err] npm ERR! gyp ERR! find Python For more information consult the documentation at: 2024-02-07T17:11:09.806Z [err] npm ERR! 2024-02-07T17:11:09.806Z [err] gyp ERR! find Python https://github.com/nodejs/node-gyp#installation 2024-02-07T17:11:09.806Z [err] npm ERR! gyp ERR! find Python ** 2024-02-07T17:11:09.806Z [err] npm ERR! 2024-02-07T17:11:09.806Z [err] gyp ERR! find Python 2024-02-07T17:11:09.806Z [err] npm ERR! gyp ERR! configure error 2024-02-07T17:11:09.806Z [err] npm ERR! 2024-02-07T17:11:09.807Z [err] gyp ERR! stack Error: Could not find any Python installation to use 2024-02-07T17:11:09.807Z [err] npm ERR! gyp ERR! stack at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:306:11) 2024-02-07T17:11:09.807Z [err] npm ERR! gyp ERR! stack at PythonFinder.findPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:164:17) 2024-02-07T17:11:09.807Z [err] npm ERR! gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 2024-02-07T17:11:09.807Z [err] npm ERR! gyp ERR! stack at async configure (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:23:18) 2024-02-07T17:11:09.807Z [err] npm 2024-02-07T17:11:09.807Z [err] ERR! gyp ERR! stack at async run (/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js:81:18) 2024-02-07T17:11:09.807Z [err] npm ERR! gyp ERR! System Linux 6.1.63-haos-raspi 2024-02-07T17:11:09.807Z [err] npm 2024-02-07T17:11:09.807Z [err] ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 2024-02-07T17:11:09.807Z [err] npm ERR! gyp ERR! cwd /config/node_modules/bufferutil 2024-02-07T17:11:09.807Z [err] npm ERR! gyp ERR! node -v v18.19.0 2024-02-07T17:11:09.807Z [err] npm ERR! 2024-02-07T17:11:09.808Z [err] gyp ERR! node-gyp -v v10.0.1 2024-02-07T17:11:09.808Z [err] npm ERR! gyp ERR! not ok 2024-02-07T17:11:09.813Z [err] 2024-02-07T17:11:09.814Z [err] npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-02-07T17_11_01_175Z-debug-0.log 2024-02-07T17:11:09.844Z rc=1

l1ttled3vil commented 5 months ago

I managed to get it sorted - just add python3 to system packages. I also needed make, gcc, g++ and libc-dev to get it to install.

Settings > Addons > Node-RED > Configuration

system_packages:
  - python3
  - make
  - gcc
  - g++
  - libc-dev

image

jeremyharris246 commented 2 months ago

That's working now thanks so much!