 Invalid response body while trying to fetch https://registry.npmjs.org/follow-redirects: EISDIR: illegal operation on a directory, open '/home/pi/.npm/_cacache/index-v5.......
### Current Situation

Hi guys, 

I"m running Homebridge on a RPi 4b and works like a charm, have several plugins installed without any issues. But lately I have some troubles with installing some new plugins and keep getting the same error message.

**Example 1:**
USER: pi
DIR: /usr/local
CMD: sudo -E -n npm install -g homebridge-tuya-platform@1.5.0

npm ERR! code EISDIR
npm ERR! syscall open
npm ERR! path /home/pi/.npm/_cacache/index-v5/95/af/22c6a839205628feaf60de48f584fed7f9639fec3479b585882f8b30e3ee
npm ERR! errno EISDIR
npm ERR! Invalid response body while trying to fetch https://registry.npmjs.org/follow-redirects: EISDIR: illegal operation on a directory, open '/home/pi/.npm/_cacache/index-v5/95/af/22c6a839205628feaf60de48f584fed7f9639fec3479b585882f8b30e3ee'

**Example 2**
USER: pi
DIR: /usr/local
CMD: sudo -E -n npm install -g homebridge-ring@11.7.3

npm ERR! code EISDIR
npm ERR! syscall open
npm ERR! path /home/pi/.npm/_cacache/index-v5/95/af/22c6a839205628feaf60de48f584fed7f9639fec3479b585882f8b30e3ee
npm ERR! errno EISDIR
npm ERR! Invalid response body while trying to fetch https://registry.npmjs.org/follow-redirects: EISDIR: illegal operation on a directory, open '/home/pi/.npm/_cacache/index-v5/95/af/22c6a839205628feaf60de48f584fed7f9639fec3479b585882f8b30e3ee'


**The following suggestions that I found online and have tried:**

**1.**
npm cache verify
npm install

**2.**
npm cache clear --force
npm install

**3.**
rm /home/pi/.npmrc

**4.**
cd /usr/local/lib/
rm -rf /node_modules
npm i 
sudo chmod -R 775 ./node_modules
sudo shutdown -r now
_Think this made it even worse_

**5.**
npm update -g npm

npm ERR! code EACCES
npm ERR! syscall open
npm ERR! path /home/pi/.npm/_cacache/tmp/80282780
npm ERR! errno -13
npm ERR! 
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR! 
npm ERR! To permanently fix this problem, please run:
npm ERR!   sudo chown -R 1000:1000 "/home/pi/.npm"

**6.**
sudo chown -R 1000:1000 "/home/pi/.npm"
npm update -g npm



### Logs

```markdown
..
757 verbose type system
758 verbose stack FetchError: Invalid response body while trying to fetch https://registry.npmjs.org/follow-redirects: EISDIR: illegal operation on a dire
ctory, open '/home/pi/.npm/_cacache/index-v5/95/af/22c6a839205628feaf60de48f584fed7f9639fec3479b585882f8b30e3ee'
758 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/minipass-fetch/lib/body.js:170:15
758 verbose stack     at async Response.json (/usr/local/lib/node_modules/npm/node_modules/minipass-fetch/lib/body.js:75:17)
758 verbose stack     at async RegistryFetcher.packument (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/registry.js:94:25)
758 verbose stack     at async RegistryFetcher.manifest (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/registry.js:118:23)
758 verbose stack     at async Promise.all (index 0)
758 verbose stack     at async [buildDepStep] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1044:5)
758 verbose stack     at async Arborist.buildIdealTree (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:207
:7)
758 verbose stack     at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:159:5)
758 verbose stack     at async Install.exec (/usr/local/lib/node_modules/npm/lib/commands/install.js:146:5)
758 verbose stack     at async module.exports (/usr/local/lib/node_modules/npm/lib/cli.js:89:5)
759 verbose cwd /usr/local
760 verbose Linux 6.1.19-v8+
761 verbose node v18.14.1
762 verbose npm  v9.6.3
763 error code EISDIR
764 error syscall open
765 error path /home/pi/.npm/_cacache/index-v5/95/af/22c6a839205628feaf60de48f584fed7f9639fec3479b585882f8b30e3ee
766 error errno EISDIR
767 error Invalid response body while trying to fetch https://registry.npmjs.org/follow-redirects: EISDIR: illegal operation on a directory, open '/home/p
i/.npm/_cacache/index-v5/95/af/22c6a839205628feaf60de48f584fed7f9639fec3479b585882f8b30e3ee'
768 verbose exit 1
769 timing npm Completed in 18626ms
770 verbose unfinished npm timer reify 1680216465731
771 verbose unfinished npm timer reify:loadTrees 1680216465741
772 verbose code 1
```


### Configuration

```json
Not applicable
```


### Environment

- OS: Raspbian GNU/Linux Bullseye (11)
- Software: 1.6.0
- Node: v18.14.1
- npm: 9.6.3


### Process Supervisor

hb-service

### Additional Context

_No response_