I expect this is due to you having to use sudo. Unfortunately, you need to strip out your current installation of Node-RED and all globally installed nodes then reinstall either using a standard installation or using a local installation under the user that will be running Node-RED.
When using a standard installation, while install of NR itself may require sudo (as it will be globally installed), you should run it under a standard user - it will create the userDir folder as
~/.node-red and you install further nodes into that folder (or use the admin menu which does the same thing).
In my personal opinion, installing Node-RED globally opens potential security issues anyway and I prefer to avoid that. However, this shouldn't be an issue if access to your server is tightly controlled. But I personally prefer not to take the risk - especially the risk of forgetting as requirements creep over time.
A local installation of Node-RED is very easy and has other potential advantages too. The reason it isn't the default method is that it is more work to set up and is confusing for novices. However, once done, it is trivial to manage.
Create a folder for the installation under the home folder for the user that will run Node-RED. Do
npm init in that folder then do
npm install node-red --save. You then need to create a data folder which becomes the userDir, I create that under the master node-red folder. Adjust the startup command to use the custom userDir and you are good to go. Of course, this doesn't create a systemd startup command - let me know if you need to know how to do that.
For me, the advantage is not only security but it allows me to run multiple instances of NR with separate userDir folders or even run different versions of NR quite easily. Also keeps everything in one place.