Skip to content
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

configure.js: escape '<' #1506

Closed
wants to merge 1 commit into from
Closed

Conversation

yeerkkiller1
Copy link

@yeerkkiller1 yeerkkiller1 commented Jul 19, 2018

Fixes: #1501

On windows invoking spawn on a batch file results in additional
argument processing. Special characters need to be escaped (twice).

Checklist
  • npm install && npm test passes
  • tests are included
  • documentation is changed or added
  • commit message follows commit guidelines
Description of change

Fixes issue where npm install fails if python is a batch file. This occurs because the batch file tries to interpret the '<' specially.

I tested this change on my windows machine (with and without python.bat in my path). I don't think this change will impact other platforms, as it only applies changes when the platform is win32, and when python is a batch file (which would have broken anyway).

@Fishrock123
Copy link
Member

@rvagg
Copy link
Member

rvagg commented Aug 9, 2018

I'm not confident enough to pull this in atm, does someone else with deep enough expertise want to confirm this is the right thing to do?

@samuelmaddock
Copy link

I'm experiencing this bug as well, any update on reviews? Applying the patch manually seems to fix the issue for me.

@rvagg
Copy link
Member

rvagg commented Jun 20, 2019

@yeerkkiller1 if you're still interested, would you mind rebasing and squashing your two commits?

On windows invoking spawn on a batch file results in additional
argument processing. Special characters need to be escaped (twice).

fixes nodejs#1501 (comment)
@yeerkkiller1
Copy link
Author

@rvagg, no problem, it's squashed and pushed now.

@rvagg
Copy link
Member

rvagg commented Jun 20, 2019

SGTM but I would love a +1 from @bzoz, @joaocgreis, @refack or one of our other core Windows experts, I've never had experience escaping in .bat with ^ (I had to Google it just now to see it was a thing!).

@jlennox
Copy link

jlennox commented Feb 24, 2020

@rvagg This is indeed the correct fix.

I just spent an hour debugging this issue myself. It would be great if this fix would be merged.

@rvagg
Copy link
Member

rvagg commented Feb 25, 2020

@bzoz, @joaocgreis, please confirm

@bzoz
Copy link
Contributor

bzoz commented Feb 25, 2020

I think this is not needed anymore. #1582 made a change that extracts the Python .exe filename even from batch files and then uses it. We are no longer using the batch file to spawn Python executables.

I've also was not able to trigger the original issue. @yeerkkiller1, @jlennox could you verify that the issue is still present in master?

Copy link
Contributor

@bzoz bzoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(just making it explicit: we should not land this if it is already fixed in master)

@rvagg
Copy link
Member

rvagg commented Feb 26, 2020

#1582 went out with v5.0.0 so should be in npm already, maybe update npm: npm install npm -g

@lukekarrys lukekarrys closed this Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

<(target_arch) not resolving, causing npm install to fail
8 participants