Skip to content

Windows: quoted arguments containing & are split when invoking node through Volta shim #2105

@ParadiseWitch

Description

@ParadiseWitch

Environment

  • OS: Windows 11 专业版 (25H2) x86_64
  • Kernel: WIN32_NT 10.0.26200.8246
  • Shell: PowerShell 7.6.0
  • Volta: 2.0.2
  • Node: v24.15.0

Reproduction

index.js:

console.log(process.argv)

Run:

node .\index.js "http://www.baidu.com?a=1&b=2"

Actual output:

[
  'C:\\nvm4w\\nodejs\\node.exe',
  'C:\\Users\\Maiii\\code\\overcook-web\\test\\index.js',
  'http://www.baidu.com?a=1'
]

'b' is not recognized as an internal or external command,
operable program or batch file.

But directly invoking the real node.exe works correctly:

C:\nvm4w\nodejs\node.exe .\index.js "http://www.baidu.com?a=1&b=2"

Output:

[
  'C:\\nvm4w\\nodejs\\node.exe',
  'C:\\Users\\Maiii\\code\\overcook-web\\test\\index.js',
  'http://www.baidu.com?a=1&b=2'
]
Image

Expected behavior

The quoted argument should be passed through unchanged:

http://www.baidu.com?a=1&b=2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions