This repository was archived by the owner on Aug 11, 2022. It is now read-only.
This repository was 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
Description
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.
npm -v
prints:6.0.1
node -v
prints:v10.1.0
npm config get registry
prints:https://registry.npmjs.org/
- OS: Windows 10
- See also Issue when passing a parameter with the
&
character to a npm cli package from PowerShell on Windows pnpm/pnpm#1199
Metadata
Metadata
Assignees
Labels
No labels