This is something that happens only on Red Hat as far as I know.
I'm running a npm module as a different user thant the one currently logged in, for example:
sudo -u username client.js
This works normally on Ubuntu and Debian, but on Red Hat it gets stuck indefinitely on this line:
response = shell.exec('whoami', { silent: true });
(it doesn't work for any command, not just whoami)
Everything works okay when the script is kicked off normaly (without sudo).