Error: Install failed
at /usr/lib/node_modules/node-red/node_modules/@node-red/registry/lib/installer.js:290:25
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
Could this be because I installed the beta using sudo npm install ... ?
Perhaps you used sudo npm, but forgot the -g, in which case you will now have files owned by root in your .node-red folder. You can sort that by going into your .node-red folder and running sudo chown -R pi:pi .
Note the dot on the end. That will set the ownership of all files there back to user pi. That should be the correct user as I see you are under the /home/pi folder.
If you missed off the -g you may have installed node-red locally into your .node-red folder, which you probably didn't want to do. Check in package.json and see whether node-red appears in the dependencies section. It shouldn't. If it does then, from the .node-red folder, run npm remove node-red
which will just remove the locally installed one. Then you can run the node red beta install again, this time remembering the -g.
You don't want to install node-red beta globally unless you have a spare device not running the current version.
To run both in parallel, install one or both locally. I always do this anyway for all my installs since it is the more "node.js way" to do things. That is what my alternate installer is about. It creates a new folder (or uses an existing one) to install node-red and creates a data sub-folder and an npm start script that directs the user-dir to the data sub-folder. That way, I know for sure that everything is completely isolated.