-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
child_process spawn does not pass environment key-value pairs on Windows #34667
Comments
This is probably a duplicate of #20605 and the copied The documentation was updated (#32091) to say:
|
I'll close this as answered. Let me know if it should be reopened. |
thanks, @richardlau, for providing the root cause.
cc: @bnoordhuis |
There should only be one variant of env: {
...process.env,
[Object.keys(process.env).find(x => x.toUpperCase() === 'PATH')]: process.env.PATH + require('path').delimiter + __dirname,
} |
What steps will reproduce the bug?
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
The text was updated successfully, but these errors were encountered: