I want to set an environment variable when running a program via child_process.exec
. Is this possible?
I tried setting the env
like this:
exec('FOO', {'FOO': 'ah'}, function(error, stdout, stderr) {console.log(stdout, stderr, error);});
but the resulting message said FOO did not exist.