Rfxcom palette will not install

After having to wipe my PC, I installed Windows, then iobroker (and Node Red). Now I cannot install the Rfxcom palette. There are errors when looking at the log. It looks as if it wanted Python, so I downloaded that (for Windows), installed it. Still errors. I dont really understand what the log is telling me. I think I might have to edit some config to point it to where the python.exe is ?

This is the error log

023-05-26T16:18:30.342Z Install : node-red-contrib-rfxcom 2.12.1

2023-05-26T16:18:30.374Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-rfxcom@2.12.1
2023-05-26T16:18:31.842Z [err] npm
2023-05-26T16:18:31.842Z [err]  WARN
2023-05-26T16:18:31.842Z [err]  config production Use `--omit=dev` instead.
2023-05-26T16:18:38.312Z [err] npm
2023-05-26T16:18:38.312Z [err]  WARN cleanup Failed to remove some directories [
2023-05-26T16:18:38.312Z [err] npm WARN cleanup   [
2023-05-26T16:18:38.312Z [err] npm WARN cleanup     'C:\\ioBroker\\node_modules\\iobroker.node-red\\userdata\\node_modules\\@serialport\\bindings',
2023-05-26T16:18:38.312Z [err] npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\ioBroker\node_modules\iobroker.node-red\userdata\node_modules\@serialport\bindings\node_modules\simple-get\.github'] {
2023-05-26T16:18:38.312Z [err] npm WARN cleanup       errno: -4048,
2023-05-26T16:18:38.312Z [err] npm WARN cleanup       code: 'EPERM',
2023-05-26T16:18:38.312Z [err] npm WARN cleanup       syscall: 'rmdir',
2023-05-26T16:18:38.312Z [err] npm WARN cleanup       path: 'C:\\ioBroker\\node_modules\\iobroker.node-red\\userdata\\node_modules\\@serialport\\bindings\\node_modules\\simple-get\\.github'
2023-05-26T16:18:38.312Z [err] npm WARN cleanup     }
2023-05-26T16:18:38.312Z [err] npm WARN cleanup   ]
2023-05-26T16:18:38.312Z [err] npm WARN cleanup ]
2023-05-26T16:18:38.314Z [err] npm ERR! code
2023-05-26T16:18:38.314Z [err]  1
2023-05-26T16:18:38.314Z [err] npm ERR! path C:\ioBroker\node_modules\iobroker.node-red\userdata\node_modules\@serialport\bindings
2023-05-26T16:18:38.315Z [err] npm ERR!
2023-05-26T16:18:38.316Z [err]  command failed
2023-05-26T16:18:38.316Z [err] npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
2023-05-26T16:18:38.316Z [err] npm ERR! prebuild-install warn install No prebuilt binaries found (target=18.16.0 runtime=node arch=x64 libc= platform=win32)
2023-05-26T16:18:38.316Z [err] npm ERR! gyp info it worked if it ends with ok
2023-05-26T16:18:38.316Z [err] npm ERR! gyp info using node-gyp@9.3.1
2023-05-26T16:18:38.316Z [err] npm
2023-05-26T16:18:38.316Z [err]  ERR! gyp info using node@18.16.0 | win32 | x64
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python 
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python checking if "python3" can be used
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python checking if "python" can be used
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python39\python.exe
2023-05-26T16:18:38.316Z [err] npm
2023-05-26T16:18:38.316Z [err]  ERR! gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python39\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39\python.exe
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python39\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python39-32\python.exe
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python39-32\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39-32\python.exe
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python39-32\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm
2023-05-26T16:18:38.316Z [err]  ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python39-32\python.exe
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python39-32\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python38\python.exe
2023-05-26T16:18:38.316Z [err] npm 
2023-05-26T16:18:38.316Z [err] ERR! gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python38\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38\python.exe
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python38\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm ERR!
2023-05-26T16:18:38.316Z [err]  gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python38-32\python.exe
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python38-32\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38-32\python.exe
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python38-32\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm
2023-05-26T16:18:38.316Z [err]  ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python38-32\python.exe
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python38-32\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python37\python.exe
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python37\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37\python.exe
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python37\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python37-32\python.exe
2023-05-26T16:18:38.316Z [err] npm 
2023-05-26T16:18:38.316Z [err] ERR! gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python37-32\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37-32\python.exe
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python37-32\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python37-32\python.exe
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python37-32\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python36\python.exe
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python36\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm ERR!
2023-05-26T16:18:38.316Z [err]  gyp ERR! find Python checking if Python is C:\Program Files\Python36\python.exe
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python36\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python36-32\python.exe
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python36-32\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm
2023-05-26T16:18:38.316Z [err]  ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36-32\python.exe
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python36-32\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python36-32\python.exe
2023-05-26T16:18:38.316Z [err] npm ERR!
2023-05-26T16:18:38.316Z [err]  gyp ERR! find Python - "C:\Program Files (x86)\Python36-32\python.exe" could not be run
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python checking if the py launcher can be used to find Python 3
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python - "py.exe" is not in PATH or produced an error
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python 
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python **********************************************************
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python You need to install the latest version of Python.
2023-05-26T16:18:38.316Z [err] npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
2023-05-26T16:18:38.316Z [err] npm ERR!
2023-05-26T16:18:38.317Z [err]  gyp ERR! find Python you can try one of the following options:
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
2023-05-26T16:18:38.317Z [err] npm ERR!
2023-05-26T16:18:38.317Z [err]  gyp ERR! find Python For more information consult the documentation at:
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! find Python **********************************************************
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! find Python 
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! configure error 
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! stack     at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:330:47)
2023-05-26T16:18:38.317Z [err] npm
2023-05-26T16:18:38.317Z [err]  ERR! gyp ERR! stack     at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:159:21)
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:228:18)
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:294:16)
2023-05-26T16:18:38.317Z [err] npm ERR!
2023-05-26T16:18:38.317Z [err]  gyp ERR! stack     at ChildProcess.exithandler (node:child_process:427:5)
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
2023-05-26T16:18:38.317Z [err] npm
2023-05-26T16:18:38.317Z [err]  ERR! gyp ERR! System Windows_NT 10.0.22621
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! cwd C:\ioBroker\node_modules\iobroker.node-red\userdata\node_modules\@serialport\bindings
2023-05-26T16:18:38.317Z [err] npm ERR!
2023-05-26T16:18:38.317Z [err]  gyp ERR! node -v v18.16.0
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! node-gyp -v v9.3.1
2023-05-26T16:18:38.317Z [err] npm ERR! gyp ERR! not ok

Seems like it cant locate your python installation.

What is the output of the python --version and which python commands in your chosen terminal?

I have never used python... had it installed before I had to wipe the disk, not sure why I had it on there...

It is version 3.11.3

and it is installed in

C:\Users\mkram\AppData\Local\Programs\Python\Python311

And have you ensured it is included in PATH environment variables in Windows?

  1. Right-clicking This PC and going to Properties.
  2. Clicking on the Advanced system settings in the menu on the left.
  3. Clicking on the Environment Variables button o​n the bottom right.
  4. In the System variables section, selecting the Path variable and clicking on Edit. The next screen will show all the directories that are currently a part of the PATH variable.
  5. Clicking on New and entering Python’s install directory.

I have tried it (see screenshot). But Node Red is still not finding the python installation
I looked at the npm config, npm config ls -l and I cannot see anything about python. Maybe it should be entered there ? Not that I would know how or even where to find the npm config...

RFXCOM does not require or use Python. It looks like npm cannot find a pre-built version of the serialport package for your combination of OS and NodeJS (which is strange) so it is trying to compile serialport from source. To do that it needs the gyp build tools, which do use Python.

See node-gyp - npm for details

But the odd thing is why npm is having to compile serialport at all. Have you tried installing the basic serialport node?

I have just tried that, I installed the serial port node. Rfxcom palette will still not install.

I could buy some more time if I could just get my flows to run without having to delete all the Rfxcom nodes... but as they are not present flows will not start

The easiest way to fix this issue for Windows is simply to go to the node.js website and reinstall the node.js package for Windows. When you do that (which is pretty quick), make sure you tick the box to get the build pre-requisites. That automates everything for you. It will install the correct version of Python and the windows build tools as needed.

When working with Node.js, it is generally sensible to have the build tools available (the build processes rely on Python) since there are plenty of npm packages that either require a build/compile step or work better with the compiled version.

In regard to the serialport package, you will commonly need to rebuild it anyway when you change major node.js versions.

It was a great step forward when (I think Microsoft) helped the node.js project to update their installer. Makes life a lot easier.

I uninstalled node.js, and reinstalled with all options ticked. Still, the rfxcom palette will not install :rage:

Same errors or some variation? Also, did you try restarting the PC or at least logging out and back in so that Windows can pick up the amended paths?

Yes I restarted Windows a few times. Errors are slightly different, but I think its still not finding python

2023-05-26T21:57:56.972Z Install : node-red-contrib-rfxcom 2.12.1

2023-05-26T21:57:56.979Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-rfxcom@2.12.1
2023-05-26T21:57:58.687Z [err] npm
2023-05-26T21:57:58.687Z [err]  
2023-05-26T21:57:58.687Z [err] WARN config production Use `--omit=dev` instead.
2023-05-26T21:58:06.299Z [err] npm
2023-05-26T21:58:06.299Z [err]  WARN cleanup
2023-05-26T21:58:06.299Z [err]  Failed to remove some directories [
2023-05-26T21:58:06.299Z [err] npm
2023-05-26T21:58:06.299Z [err]  WARN cleanup   [
2023-05-26T21:58:06.299Z [err] npm WARN cleanup     'C:\\ioBroker\\node_modules\\iobroker.node-red\\userdata\\node_modules\\rfxcom',
2023-05-26T21:58:06.299Z [err] npm WARN cleanup     [Error: EPERM: operation not permitted, unlink 'C:\ioBroker\node_modules\iobroker.node-red\userdata\node_modules\rfxcom\spec\support\jasmine.json'] {
2023-05-26T21:58:06.299Z [err] npm WARN 
2023-05-26T21:58:06.299Z [err] cleanup       errno: -4048,
2023-05-26T21:58:06.299Z [err] npm WARN cleanup       code: 'EPERM',
2023-05-26T21:58:06.299Z [err] npm 
2023-05-26T21:58:06.299Z [err] WARN cleanup       syscall: 'unlink',
2023-05-26T21:58:06.299Z [err] npm WARN cleanup
2023-05-26T21:58:06.299Z [err]        path: 'C:\\ioBroker\\node_modules\\iobroker.node-red\\userdata\\node_modules\\rfxcom\\spec\\support\\jasmine.json'
2023-05-26T21:58:06.299Z [err] npm WARN 
2023-05-26T21:58:06.299Z [err] cleanup     }
2023-05-26T21:58:06.299Z [err] npm WARN cleanup   ]
2023-05-26T21:58:06.299Z [err] npm 
2023-05-26T21:58:06.299Z [err] WARN cleanup ]
2023-05-26T21:58:06.303Z [err] npm
2023-05-26T21:58:06.303Z [err]  ERR! code 1
2023-05-26T21:58:06.303Z [err] npm ERR! path C:\ioBroker\node_modules\iobroker.node-red\userdata\node_modules\@serialport\bindings
2023-05-26T21:58:06.305Z [err] npm ERR!
2023-05-26T21:58:06.305Z [err]  command failed
2023-05-26T21:58:06.305Z [err] npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
2023-05-26T21:58:06.305Z [err] npm ERR!
2023-05-26T21:58:06.305Z [err]  prebuild-install warn install No prebuilt binaries found (target=18.16.0 runtime=node arch=x64 libc= platform=win32)
2023-05-26T21:58:06.305Z [err] npm ERR! gyp info it worked if it ends with ok
2023-05-26T21:58:06.305Z [err] npm ERR! gyp info using node-gyp@9.3.1
2023-05-26T21:58:06.305Z [err] npm 
2023-05-26T21:58:06.305Z [err] ERR! gyp info using node@18.16.0 | win32 | x64
2023-05-26T21:58:06.305Z [err] npm ERR! gyp ERR! find Python 
2023-05-26T21:58:06.305Z [err] npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
2023-05-26T21:58:06.305Z [err] npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
2023-05-26T21:58:06.305Z [err] npm ERR! gyp ERR! find Python checking if "python3" can be used
2023-05-26T21:58:06.305Z [err] npm ERR!
2023-05-26T21:58:06.305Z [err]  gyp ERR! find Python - "python3" is not in PATH or produced an error
2023-05-26T21:58:06.305Z [err] npm ERR! gyp ERR! find Python checking if "python" can be used
2023-05-26T21:58:06.305Z [err] npm ERR!
2023-05-26T21:58:06.305Z [err]  gyp ERR! find Python - "python" is not in PATH or produced an error
2023-05-26T21:58:06.305Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python39\python.exe
2023-05-26T21:58:06.305Z [err] npm ERR! gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python39\python.exe" could not be run
2023-05-26T21:58:06.305Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39\python.exe
2023-05-26T21:58:06.305Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python39\python.exe" could not be run
2023-05-26T21:58:06.305Z [err] npm ERR!
2023-05-26T21:58:06.305Z [err]  gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python39-32\python.exe
2023-05-26T21:58:06.305Z [err] npm ERR! gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python39-32\python.exe" could not be run
2023-05-26T21:58:06.305Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39-32\python.exe
2023-05-26T21:58:06.305Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python39-32\python.exe" could not be run
2023-05-26T21:58:06.305Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python39-32\python.exe
2023-05-26T21:58:06.305Z [err] npm 
2023-05-26T21:58:06.305Z [err] ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python39-32\python.exe" could not be run
2023-05-26T21:58:06.305Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python38\python.exe
2023-05-26T21:58:06.305Z [err] npm ERR!
2023-05-26T21:58:06.305Z [err]  gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python38\python.exe" could not be run
2023-05-26T21:58:06.305Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38\python.exe
2023-05-26T21:58:06.305Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python38\python.exe" could not be run
2023-05-26T21:58:06.305Z [err] npm 
2023-05-26T21:58:06.305Z [err] ERR! gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python38-32\python.exe
2023-05-26T21:58:06.305Z [err] npm ERR! gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python38-32\python.exe" could not be run
2023-05-26T21:58:06.305Z [err] npm ERR!
2023-05-26T21:58:06.305Z [err]  gyp ERR! find Python checking if Python is C:\Program Files\Python38-32\python.exe
2023-05-26T21:58:06.305Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python38-32\python.exe" could not be run
2023-05-26T21:58:06.305Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python38-32\python.exe
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python38-32\python.exe" could not be run
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python37\python.exe
2023-05-26T21:58:06.306Z [err] npm 
2023-05-26T21:58:06.306Z [err] ERR! gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python37\python.exe" could not be run
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37\python.exe
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python37\python.exe" could not be run
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python37-32\python.exe
2023-05-26T21:58:06.306Z [err] npm 
2023-05-26T21:58:06.306Z [err] ERR! gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python37-32\python.exe" could not be run
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37-32\python.exe
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python37-32\python.exe" could not be run
2023-05-26T21:58:06.306Z [err] npm ERR!
2023-05-26T21:58:06.306Z [err]  gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python37-32\python.exe
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python37-32\python.exe" could not be run
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python36\python.exe
2023-05-26T21:58:06.306Z [err] npm ERR!
2023-05-26T21:58:06.306Z [err]  gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python36\python.exe" could not be run
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36\python.exe
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python36\python.exe" could not be run
2023-05-26T21:58:06.306Z [err] npm
2023-05-26T21:58:06.306Z [err]  ERR! gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python36-32\python.exe
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python36-32\python.exe" could not be run
2023-05-26T21:58:06.306Z [err] npm ERR!
2023-05-26T21:58:06.306Z [err]  gyp ERR! find Python checking if Python is C:\Program Files\Python36-32\python.exe
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python36-32\python.exe" could not be run
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python36-32\python.exe
2023-05-26T21:58:06.306Z [err] npm
2023-05-26T21:58:06.306Z [err]  ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python36-32\python.exe" could not be run
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python checking if the py launcher can be used to find Python 3
2023-05-26T21:58:06.306Z [err] npm ERR!
2023-05-26T21:58:06.306Z [err]  gyp ERR! find Python - "py.exe" is not in PATH or produced an error
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python 
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python **********************************************************
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python You need to install the latest version of Python.
2023-05-26T21:58:06.306Z [err] npm ERR!
2023-05-26T21:58:06.306Z [err]  gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python you can try one of the following options:
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
2023-05-26T21:58:06.306Z [err] npm 
2023-05-26T21:58:06.306Z [err] ERR! gyp ERR! find Python - Set the npm configuration variable python:
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
2023-05-26T21:58:06.306Z [err] npm ERR!
2023-05-26T21:58:06.306Z [err]  gyp ERR! find Python For more information consult the documentation at:
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! find Python **********************************************************
2023-05-26T21:58:06.306Z [err] npm 
2023-05-26T21:58:06.306Z [err] ERR! gyp ERR! find Python 
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! configure error 
2023-05-26T21:58:06.306Z [err] npm ERR!
2023-05-26T21:58:06.306Z [err]  gyp ERR! stack Error: Could not find any Python installation to use
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! stack     at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:330:47)
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! stack     at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:159:21)
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:228:18)
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:294:16)
2023-05-26T21:58:06.306Z [err] npm ERR!
2023-05-26T21:58:06.306Z [err]  gyp ERR! stack     at ChildProcess.exithandler (node:child_process:427:5)
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
2023-05-26T21:58:06.306Z [err] npm ERR!
2023-05-26T21:58:06.306Z [err]  gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! System Windows_NT 10.0.22621
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! cwd C:\ioBroker\node_modules\iobroker.node-red\userdata\node_modules\@serialport\bindings
2023-05-26T21:58:06.306Z [err] npm 
2023-05-26T21:58:06.306Z [err] ERR! gyp ERR! node -v v18.16.0
2023-05-26T21:58:06.306Z [err] npm ERR! gyp ERR! node-gyp -v v9.3.1
2023-05-26T21:58:06.306Z [err] npm ERR!
2023-05-26T21:58:06.307Z [err]  gyp ERR! not ok

Hmm, from a command line, can you type python?

Also, try this from PowerShell:

image

Also from PowerShell, type $env:path and make sure that the path to python found from whereis is included in the paths. If not, you will have to add it manually.

Typing python from a command line opens the windows store.. really weird. Whereis doesnt seem to work. Maybe as I am on Windows 11 ?
And it looks as if the python path is in the env variable, its installed in C:\Python which is listed

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\mkram> whereis python
whereis : The term 'whereis' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • whereis python
  •   + CategoryInfo          : ObjectNotFound: (whereis:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    

PS C:\Users\mkram> $env:path
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\nodejs;C:\ProgramData\chocolatey\bin;C:\Python\Scripts;C:\Python;C:\Users\mkram\AppData\Local\Microsoft\WindowsApps;C:\Users\mkram\AppData\Roaming\npm
PS C:\Users\mkram>

Sorry, my bad, I always forget that whereis is an alias. I have this in my PowerShell profile:

set-alias -Name:"whereis" -Value:"where.exe" -Description:"Where is a file really?" -Option:"AllScope" -Scope "Global"

I put that in to make it the same as when using Linux. Best to add the alias because it changes the scope which means that whereis picks up things that the default where does not even though they are the same command.

No, I'm on 11 as well.

What is in the folder c:\python? If there should be a python.exe file. If there isn't, something is wrong with the installation.

I set the whereis.

PS C:\WINDOWS\system32> set-alias -Name:"whereis" -Value:"where.exe" -Description:"Where is a file really?" -Option:"AllScope" -Scope "Global"
PS C:\WINDOWS\system32> whereis python
C:\Users\mkram\AppData\Local\Microsoft\WindowsApps\python.exe
PS C:\WINDOWS\system32>

The C:\Python does NOT contain python.exe
That is in a directory C:\Python311

I have changed and played around with the environment variables
None of it worked

Screenshot 2023-05-27 112546

I managed to delete python, reinstall. Then the palette wanted Visual Studio. I installed that, and the Rfxcom palette finally installed.
But now, the flow from my backup which had been running for days on the previous installation without problems, now keeps crashing Node Red and Node Red keeps restarting and exiting with the same error
Node Red is running in iobroker for Windows

node-red.0
2023-05-27 13:30:20.406 info node-red exited with 6

node-red.0
2023-05-27 13:29:48.153 warn Terminated (UNCAUGHT_EXCEPTION): Without reason

node-red.0
2023-05-27 13:29:48.152 info terminating

What should have been in your path is C:\Users\mkram\AppData\Local\Microsoft\WindowsApps.

I've never used ioBroker - could that be causing these issues?

I note that you have quite a lot of things trying to install to c:\something\. That is really an anti-pattern that has existed for quite a few years. W10/11 both require admin rights to install things to c:\ (just as Linux requires root to install outside your home folder). This is to help limit the damage that attacking malware can easily do.

So if you are installing to or updating in c:\something, you have to give local admin permissions. Conversely, anything installed to C:\Users\<userid>\AppData\ does not require elevated permissions.

I did try to look at the documentation for ioBroker to see if I could see what it was doing in terms of installation but its docs a little hit and miss. I couldn't see anything too odd. As long as python and node work from a standard command line and as long as you have the visual studio windows build tools installed, everything else should work.

Have you asked in the iobroker forum? I don't think I know anyone who uses iobroker for windows.

I have not looked to see if there is a iobroker forum, as I thought the error is Node Red related. On my previous (Windows 10) installation, I was also running Node Red in iobroker. Before updating to Windows 11, I backed up the flow, and made a list of the palettes I need to install before importing the flow again.
Its easier to restart NR from another PC on the network, also previously when I was running NR in Windows, it kept crashing, and I had to log onto the PC it was running on to restart it

Well, while I can't be certain, I can say that node-red runs constantly and consistently on my Windows PC and has done for many years. But I run it directly (well mostly via PM2 but that is mainly to have auto-restarts on changes of code and settings).

Of course, I can't tell how you have your PC configured overall and it was certainly odd to have problems with Python and build tools since the updated node.js installer seems pretty good at taking care of all of that these days.

I must admit that I'd be tempted at this point, if it were me, to remove all traces of Python and all traces of node.js, possibly of ioBroker as well. Then reboot (make sure that traces are removed from path, etc). Then install node.js clean (with the build tools option), make sure it and python run from a standard command prompt. Then reinstall ioBroker.

Well, you need to find out what is doing that. Typically it is an installed node that is misbehaving since Node-RED itself has always been remarkably stable on all platforms.

As for restarting. That depends on how you are making Node-RED run - presumably, from your description, either as a service or unattended startup. In both of those scenarios, you can configure it to auto-restart. If you have remote admin turned on (via wmic for example), then you can use powershell remotely to restart things as well. Alternatively, modern versions of Windows will let you get a remote command line in a variety of ways so that would also be possible.