node is probably not in the root user's $PATH.
I checked the su documentation and noticed the following:
-m, -p, --preserve-environment
Preserve the current environment, except for:
$PATH
reset according to the /etc/login.defs options ENV_PATH or ENV_SUPATH (see below);
[...]
ENV_PATH (string)
If set, it will be used to define the PATH environment variable when a regular user login. The value can be
preceded by PATH=, or a colon separated list of paths (for example /bin:/usr/bin). The default value is
PATH=/bin:/usr/bin.
ENV_SUPATH (string)
If set, it will be used to define the PATH environment variable when the superuser login. The value can be
preceded by PATH=, or a colon separated list of paths (for example /sbin:/bin:/usr/sbin:/usr/bin). The default
value is PATH=/sbin:/bin:/usr/sbin:/usr/bin.
So while you may have node in the current $PATH, it may not be in root's $PATH.
As some commenters have already mentioned, you may try giving an absolute $PATHto node:
su -p -s /bin/sh root -c "/path/to/node"
If you can call node from your current user, try which node to determine the full path to the executable.
You may also try echoing your $PATH.
su -p -s /bin/sh root -c 'echo $PATH'
PATH? Tryecho $PATHbefore executing the command.ls -a /path/to/nodesu -pshould preserve environment, includingPATH, but I'm skeptical as well.PATHproblem. That's why I was skeptical. Glad it makes sense.