Installation of a palette?

Hi

I try to install a palette in my Node-Red add-on in HAOS but it fails. It looks like it’s unable to install python dependency. Is there a way to go around ? or it’s a dead-end with Node-Red on HAOS ?
Palette I try to install: node-red-contrib-socketcan (node) - Node-RED
Logs of install in node-red of the palette:

-----------------------------------------------------------
2025-01-08T15:19:56.497Z Installer : node-red-contrib-socketcan 1.2.14

2025-01-08T15:19:56.533Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --omit=dev --engine-strict [email protected]
2025-01-08T15:20:04.717Z [err] npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
2025-01-08T15:20:04.729Z [err] npm warn deprecated [email protected]: This package is no longer supported.
2025-01-08T15:20:04.758Z [err] npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
2025-01-08T15:20:04.777Z [err] npm warn deprecated [email protected]: This package is no longer supported.
2025-01-08T15:20:04.784Z [err] npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
2025-01-08T15:20:04.843Z [err] npm warn deprecated [email protected]: This package is no longer supported.
2025-01-08T15:20:05.330Z [err] npm warn cleanup Failed to remove some directories [
2025-01-08T15:20:05.330Z [err] npm warn cleanup   [
2025-01-08T15:20:05.330Z [err] npm warn cleanup     '/config/node_modules/bcrypt',
2025-01-08T15:20:05.330Z [err] npm warn cleanup     [Error: ENOTEMPTY: directory not empty, rmdir '/config/node_modules/bcrypt'] {
2025-01-08T15:20:05.330Z [err] npm warn cleanup       errno: -39,
2025-01-08T15:20:05.330Z [err] npm warn cleanup       code: 'ENOTEMPTY',
2025-01-08T15:20:05.330Z [err] npm warn cleanup       syscall: 'rmdir',
2025-01-08T15:20:05.330Z [err] npm warn cleanup       path: '/config/node_modules/bcrypt'
2025-01-08T15:20:05.330Z [err] npm warn cleanup     }
2025-01-08T15:20:05.330Z [err] npm warn cleanup   ],
2025-01-08T15:20:05.330Z [err] npm warn cleanup   [
2025-01-08T15:20:05.330Z [err] npm warn cleanup     '/config/node_modules/bcrypt',
2025-01-08T15:20:05.330Z [err] npm warn cleanup     [Error: ENOTEMPTY: directory not empty, rmdir '/config/node_modules/bcrypt'] {
2025-01-08T15:20:05.330Z [err] npm warn cleanup       errno: -39,
2025-01-08T15:20:05.330Z [err] npm warn cleanup       code: 'ENOTEMPTY',
2025-01-08T15:20:05.330Z [err] npm warn cleanup       syscall: 'rmdir',
2025-01-08T15:20:05.330Z [err] npm warn cleanup       path: '/config/node_modules/bcrypt'
2025-01-08T15:20:05.330Z [err] npm warn cleanup     }
2025-01-08T15:20:05.330Z [err] npm warn cleanup   ]
2025-01-08T15:20:05.330Z [err] npm warn cleanup ]
2025-01-08T15:20:05.334Z [err] npm error code 1
2025-01-08T15:20:05.334Z [err] npm error path /config/node_modules/socketcan
2025-01-08T15:20:05.334Z [err] npm error command failed
2025-01-08T15:20:05.334Z [err] npm error command sh -c node-gyp rebuild
2025-01-08T15:20:05.334Z [err] npm error gyp info it worked if it ends with ok
2025-01-08T15:20:05.334Z [err] npm error gyp info using [email protected]
2025-01-08T15:20:05.334Z [err] npm error gyp info using [email protected] | linux | x64
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python 
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python checking Python explicitly set from command line or npm configuration
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python - "--python=" or "npm config get python" is "/usr/bin/python3"
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python - executable path is ""
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python - "" could not be run
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python Python is not set from environment variable PYTHON
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python checking if "python3" can be used
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python - executable path is ""
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python - "" could not be run
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python checking if "python" can be used
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python - executable path is ""
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python - "" could not be run
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python 
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python **********************************************************
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python You need to install the latest version of Python.
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python you can try one of the following options:
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python (accepted by both node-gyp and npm)
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python - Set the environment variable PYTHON
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python - Set the npm configuration variable python:
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python npm config set python "/path/to/pythonexecutable"
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python For more information consult the documentation at:
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python **********************************************************
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! find Python 
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! configure error 
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! stack Error: Could not find any Python installation to use
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! stack at PythonFinder.fail (/config/node_modules/node-gyp/lib/find-python.js:306:11)
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! stack at PythonFinder.findPython (/config/node_modules/node-gyp/lib/find-python.js:164:17)
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! stack at async configure (/config/node_modules/node-gyp/lib/configure.js:27:18)
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! stack at async run (/config/node_modules/node-gyp/bin/node-gyp.js:81:18)
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! System Linux 6.6.66-haos
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! command "/usr/bin/node" "/config/node_modules/.bin/node-gyp" "rebuild"
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! cwd /config/node_modules/socketcan
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! node -v v22.11.0
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! node-gyp -v v11.0.0
2025-01-08T15:20:05.334Z [err] npm error gyp ERR! not ok
2025-01-08T15:20:05.336Z [err] npm error A complete log of this run can be found in: /root/.npm/_logs/2025-01-08T15_19_56_613Z-debug-0.log
2025-01-08T15:20:05.350Z rc=1

Thanks

Vincèn

Looks like something failed to build before and now you have a half installation of that node module B-Crypt — you might want to delete that folder and verify that the compile works next time.

Some nodes require additional modules that do not auto install. You will need to go to the configuration page of the addon. Where it says system packages, add the name of each package in the link above. They will show as little bubbles. Then save and restart.

image

The HA add-on for Node-RED is a modified and cutdown package of Node-RED that contains the executable code but does not include the source. The big one that is missing from the NR package is a link to Python, so any palette install of nodes where npm needs to build the executable from the node source is likely to fail.

There are a couple of ways around this. The “best” answer is to run Node-RED independently on, for example, a Raspberry Pi. I have installed the exact node you are trying to instal without any issue.

Another answer is to load up Python and other missing packages into Node-RED

https://community.home-assistant.io/t/cannot-install-nodered-with-additional-package/718007/2?u=biscuit

There are various discussion posts with ‘lists’ of the extra packages required, and clearly you don’t want to add stuff you don’t need, so perhaps some experimentation adding python3 then make / gcc / g++ if required…

Some have had success:

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