Unable to uninstall plugins after update
### Analysis

Running the uninstall command, either via the UI or via terminal with npm uninstall homebridge-weather-plus

The plugin is not unsintalled, instead the below error is generated.

[Homebridge v1.8.4](https://github.com/homebridge) · [UI v4.58.0](https://github.com/homebridge/homebridge-config-ui-x)

### Expected Behavior

Plugins are removed and no error messages are thrown 

### Steps To Reproduce

Running the uninstall command, either via the UI or via terminal with npm uninstall homebridge-weather-plus

### Logs

```markdown
0 verbose cli /opt/homebridge/bin/node /opt/homebridge/bin/npm
1 info using npm@10.8.2
2 info using node@v20.17.0
3 silly config load:file:/opt/homebridge/lib/node_modules/npm/npmrc
4 warn config global-style This option has been deprecated in favor of `--install-strategy=shallow`
5 silly config load:file:/var/lib/homebridge/.npmrc
6 warn config global-style This option has been deprecated in favor of `--install-strategy=shallow`
7 silly config load:file:/home/homebridge/.npmrc
8 silly config load:file:/opt/homebridge/etc/npmrc
9 verbose title npm uninstall homebridge-weather-plus
10 verbose argv "uninstall" "--save" "homebridge-weather-plus"
11 verbose logfile logs-max:10 dir:/home/homebridge/.npm/_logs/2024-09-08T15_54_01_436Z-
12 verbose logfile /home/homebridge/.npm/_logs/2024-09-08T15_54_01_436Z-debug-0.log
13 silly logfile start cleaning logs, removing 2 files
14 verbose stack TypeError: Class extends value undefined is not a constructor or null
14 verbose stack     at Object.<anonymous> (/opt/homebridge/lib/node_modules/npm/node_modules/minipass-collect>
14 verbose stack     at Module._compile (node:internal/modules/cjs/loader:1469:14)
14 verbose stack     at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
14 verbose stack     at Module.load (node:internal/modules/cjs/loader:1288:32)
14 verbose stack     at Module._load (node:internal/modules/cjs/loader:1104:12)
14 verbose stack     at Module.require (node:internal/modules/cjs/loader:1311:19)
14 verbose stack     at require (node:internal/modules/helpers:179:18)
14 verbose stack     at Object.<anonymous> (/opt/homebridge/lib/node_modules/npm/node_modules/cacache/lib/get.>
14 verbose stack     at Module._compile (node:internal/modules/cjs/loader:1469:14)
14 verbose stack     at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
15 error Class extends value undefined is not a constructor or null
16 verbose cwd /var/lib/homebridge
17 verbose os Linux 6.6.31+rpt-rpi-v8
18 verbose node v20.17.0
19 verbose npm  v10.8.2
20 verbose exit 1
21 verbose code 1
22 error A complete log of this run can be found in: /home/homebridge/.npm/_logs/2024-09-08T15_54_01_436Z-debu>
```


### Configuration

```json
N/A
```


### Environment

- OS: 
- Software: 1.8.4
- Node: 20.17.0
- npm: 10.8.2


### Process Supervisor

hb-service

### Additional Context

_No response_