Closed
Description
- Version: 12.18.3
- Platform: 64-bit Windows
What steps will reproduce the bug?
require('child_process').spawn('node', ['-pe', 'process.env.PATH'], {
stdio: 'inherit',
shell: true,
env: {
...process.env,
PATH: process.env.PATH + require('path').delimiter + __dirname,
}
});
Actual behavior: PATH environment variable is not updated in the spawned process.
How often does it reproduce? Is there a required condition?
Always on Windows. It is not an issue on OSX.
What is the expected behavior?
PATH environment variable should be updated in the spawned process.
What do you see instead?
add a fake env variable to the env object passed to spawn
require('child_process').spawn('node', ['-pe', 'process.env.PATH'], {
stdio: 'inherit',
shell: true,
env: {
...process.env,
PATH: process.env.PATH + require('path').delimiter + __dirname,
FAKEENV: 'FAKEVALUE',
}
});