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
Invalid command line switch for "cmd.exe" System.argumentException: Item has already been added. (PATH vs Path) #232
Comments
@TomzBench did you find a workaround for this? |
I tracked the issue down to nodejs/node#35210 so if this could be backported to older versions of nodejs then this issue I think will disappear. |
Going through the code it looks like in master this was addressed as a specific workaround: cmake-js/lib/processHelpers.js Line 12 in e311b71
If the sanitize in nodejs could be backported, probably that hardfix could be removed as well. |
Until a new release is out, I'm using the change from that commit as well:
|
fixed as of 6.2.1 |
@unbornchikken I tested 6.2.1 and that fix does not solve the issue, it continues there. I added the line from my PR, and that effictively solves the issue: if (process.platform === "win32" && process.env.Path !== undefined && process.env.PATH !== undefined) {
const PATH = process.env.Path;
delete process.env.PATH;
process.env.Path = PATH;
} |
@unbornchikken current condition won't work because: if (env.Path && en.PATH && env.Path !== env.PATH) won't be true when this line: env.PATH = `$env.Path};${env.PATH}`; should be in a different inner condition. |
Hello,
When building my package with Git Bash shell I receive the following error:
I think this issue is very closely related to this issue: dotnet/msbuild#5726
The problem is not clear how to fix, though MSBUILD suggests that this is a "wontfix" and that I should work around the issue. But it's not clear what to add to my cmake-js usage to work around this issue. It's seems the workaround is required in cmake-js?
The text was updated successfully, but these errors were encountered: