Skip to content

[BUG] Arguments are not correctly passed from CLI to npm script (npm 7, Windows, Powershell) #3136

@cyberbiont

Description

@cyberbiont

Environment:

  • OS: Windows 10Pro 20H4
  • Node: 16.0.0
  • npm: 7.11.0

package.json:

...
"script": { 
    "git": "git",
    "help": "npm run git -- --help"
}

npm run help // I get help about Git (as intended)
npm run git -- --help from Powershell // I get help about npm run-script

As far as I can tell, the problem exists only in Powershell on Windows.
cmd and Git Bash work as intended.
Bash and pwsh on Linux also work as intended.

The problem is new to npm7 (I switched back to npm6 and it worked as intended).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingPriority 2secondary priority issueRelease 7.xwork is associated with a specific npm 7 releaseplatform:windowsis Windows-specific

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions