Disastrous attempt to update node.js on Mac
### Current Status:

`hb-service update-node` is failing on MacOS, on M/Arm based Mac's.  As a workaround, it has been reported that if you just re-run the `hb-service update-node` command, it will repair itself.


### Current Situation

My node.js was on 18.something, so I thought I’d update it. I ran hb-service update-node from Terminal, but it failed miserably, even complaining that Python wasn’t installed. After that, I couldn’t access the Homebridge GUI. Then I installed node.js 20.9.0 by following the link at https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-macOS. Homebridge still wouldn’t start. So then I installed Homebridge using ``sudo npm install -g --unsafe-perm homebridge homebridge-config-ui-x`` and the service too using ``sudo hb-service install``. After that, Homebridge was fine again.

What went wrong using the preferred node update method?

### Logs

```markdown
steve@mac ~ % sudo hb-service update-node
Password:
ℹ Updating Node.js from v18.18.0 to v22.11.0...
ℹ Target: /usr/local
✔ Download complete.
✔ Cleaned up npm at at /usr/local/lib/node_modules/npm
✔ Installed Node.js v22.11.0
npm error code 1
npm error path /usr/local/lib/node_modules/homebridge-config-ui-x/node_modules/@homebridge/node-pty-prebuilt-multiarch
npm error command failed
npm error command sh -c node scripts/check-prebuild.js || prebuild-install --verbose || node scripts/install.js
npm error Prebuild binary missing for platform.
npm error prebuild-install info begin Prebuild-install version 7.1.2
npm error prebuild-install info looking for local prebuild @ prebuilds/node-pty-prebuilt-multiarch-v0.11.14-node-v127-darwin-arm64.tar.gz
npm error prebuild-install info looking for cached prebuild @ /Users/steve/.npm/_prebuilds/392543-node-pty-prebuilt-multiarch-v0.11.14-node-v127-darwin-arm64.tar.gz
npm error prebuild-install http request GET https://github.com/homebridge/node-pty-prebuilt-multiarch/releases/download/v0.11.14/node-pty-prebuilt-multiarch-v0.11.14-node-v127-darwin-arm64.tar.gz
npm error prebuild-install http 200 https://github.com/homebridge/node-pty-prebuilt-multiarch/releases/download/v0.11.14/node-pty-prebuilt-multiarch-v0.11.14-node-v127-darwin-arm64.tar.gz
npm error prebuild-install info downloading to @ /Users/steve/.npm/_prebuilds/392543-node-pty-prebuilt-multiarch-v0.11.14-node-v127-darwin-arm64.tar.gz.42681-a954583494fe3.tmp
npm error prebuild-install info renaming to @ /Users/steve/.npm/_prebuilds/392543-node-pty-prebuilt-multiarch-v0.11.14-node-v127-darwin-arm64.tar.gz
npm error prebuild-install info unpacking @ /Users/steve/.npm/_prebuilds/392543-node-pty-prebuilt-multiarch-v0.11.14-node-v127-darwin-arm64.tar.gz
npm error prebuild-install info unpack resolved to /usr/local/lib/node_modules/homebridge-config-ui-x/node_modules/@homebridge/node-pty-prebuilt-multiarch/build/Release/pty.node
npm error sh: line 1: 42681 Killed: 9               prebuild-install --verbose
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@10.2.0
npm error gyp info using node@22.11.0 | darwin | arm64
npm error gyp ERR! find Python 
npm error gyp ERR! find Python Python is not set from command line or npm configuration
npm error gyp ERR! find Python Python is not set from environment variable PYTHON
npm error gyp ERR! find Python checking if "python3" can be used
npm error gyp ERR! find Python - executable path is ""
npm error gyp ERR! find Python - "" could not be run
npm error gyp ERR! find Python checking if "python" can be used
npm error gyp ERR! find Python - executable path is ""
npm error gyp ERR! find Python - "" could not be run
npm error gyp ERR! find Python 
npm error gyp ERR! find Python **********************************************************
npm error gyp ERR! find Python You need to install the latest version of Python.
npm error gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm error gyp ERR! find Python you can try one of the following options:
npm error gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
npm error gyp ERR! find Python (accepted by both node-gyp and npm)
npm error gyp ERR! find Python - Set the environment variable PYTHON
npm error gyp ERR! find Python - Set the npm configuration variable python:
npm error gyp ERR! find Python npm config set python "/path/to/pythonexecutable"
npm error gyp ERR! find Python For more information consult the documentation at:
npm error gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
npm error gyp ERR! find Python **********************************************************
npm error gyp ERR! find Python 
npm error gyp ERR! configure error 
npm error gyp ERR! stack Error: Could not find any Python installation to use
npm error gyp ERR! stack at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:306:11)
npm error gyp ERR! stack at PythonFinder.findPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:164:17)
npm error gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
npm error gyp ERR! stack at async configure (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:27:18)
npm error gyp ERR! stack at async run (/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js:81:18)
npm error gyp ERR! System Darwin 24.1.0
npm error gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm error gyp ERR! cwd /usr/local/lib/node_modules/homebridge-config-ui-x/node_modules/@homebridge/node-pty-prebuilt-multiarch
npm error gyp ERR! node -v v22.11.0
npm error gyp ERR! node-gyp -v v10.2.0
npm error gyp ERR! not ok
npm error A complete log of this run can be found in: /Users/steve/.npm/_logs/2024-11-02T07_04_34_364Z-debug-0.log
Error: Command failed: npm rebuild --unsafe-perm
✖ ERROR: Failed Operation
ℹ Stopping Homebridge Service...
✔ Homebridge Stopped
ℹ Starting Homebridge Service...
✔ Homebridge Started
```


### Configuration

```json
NA
```

### Environment

- OS: Mac Sequoia 15.1
- Software: Homebridge 1.8.5
- Node: 20.9.0 (now)
- npm: 10.1.0 (now)


### Process Supervisor

hb-service

### Additional Context

Also reported here - https://www.reddit.com/r/homebridge/comments/1gvtlnv/updating_nodejs_fail/


_No response_