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.
You have to pass an options object that includes the key env whose value is itself an object of key value pairs.