You must be able to run ss or lsof as root to gather the node-s PID in their ouput,
as I HIGHLY DO NOT RECOMMEND running a node and this script as root.
The easiest way is just add simmilar entries as the following into the /etc/sudoers or create a file under /etc/sudoers.d/
The /etc/sudoers example, but pls ensure that the path to those files are correct:
User_Alias SPO=spo,ahtn,shmn