not using the -g tag, this will work
systemctl stop node-red
cd /mnt/dietpi_userdata/node-red
sudo -u nodered npm i --no-audit node-red@next
systemctl start node-red
not using the -g tag, this will work
systemctl stop node-red
cd /mnt/dietpi_userdata/node-red
sudo -u nodered npm i --no-audit node-red@next
systemctl start node-red