Can’t read my environment variable in my Node.js app

You need to export shell variables in order to make them available to processes you execute in your shell.

Compare the output of this command:

FOO=bar; bash -c 'echo $FOO'

with the output of this:

export FOO=bar; bash -c 'echo $FOO'

Leave a Comment