-
-
Notifications
You must be signed in to change notification settings - Fork 33k
Closed
Labels
child_processIssues and PRs related to the child_process subsystem.Issues and PRs related to the child_process subsystem.questionIssues that look for answers.Issues that look for answers.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
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',
}
});
Metadata
Metadata
Assignees
Labels
child_processIssues and PRs related to the child_process subsystem.Issues and PRs related to the child_process subsystem.questionIssues that look for answers.Issues that look for answers.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.