Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Issue when passing a parameter with the & character to a npm cli package from PowerShell on Windows #20699

Open
2 of 5 tasks
ExE-Boss opened this issue May 21, 2018 · 0 comments

Comments

@ExE-Boss
Copy link

ExE-Boss commented May 21, 2018

I'm opening this issue because:

  • npm is crashing.
  • npm is producing an incorrect install.
  • npm is doing something I don't understand.
  • npm is producing incorrect or undesirable behavior.
  • Other (see below for feature requests):

What's going wrong?

PowerShell can’t properly pass string arguments containing the & symbol to Windows Command Prompt scripts, if the string containing the ampersand doesn’t have spaces, due to how the cmd prompt parses the & as a command delimiter, even in a string.

How can the CLI team reproduce the problem?

The following PowerShell log demonstrates the issue:

PS C:\> echo-cli 'https://example.com/?a=1&b=2'
https://example.com/?a=1
'b' is not recognized as an internal or external command,
operable program or batch file.

I’m providing a fix in npm/cmd-shim#27.

PowerShell log with said fix applied:

PS C:\> echo-cli 'https://example.com/?a=1&b=2'
https://example.com/?a=1&b=2

supporting information:

This happens on both PowerShell 6 and Windows PowerShell 5.1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant