I'm running a Node/Express web server on an AWS EC2 box with Ubuntu server 12.04, and I set 4 environment variables in the .bashrc file to access my database. If I run the server as a normal user, it works fine. However, if I run node as sudo, the environment variables are undefined.
Any idea why it's not working?
Environment variables are not passed to
sudo
: How to keep Environment Variables when Using SUDO