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

[BUG] npm run -- <args> not working #3336

Closed
1 task done
v1d3rm3 opened this issue May 30, 2021 · 4 comments
Closed
1 task done

[BUG] npm run -- <args> not working #3336

v1d3rm3 opened this issue May 30, 2021 · 4 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release

Comments

@v1d3rm3
Copy link

v1d3rm3 commented May 30, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When i have a script definition, like test in package.json, when i try to execute this command with arguments, npm is interpreting as a npm cli argument.

Ex:
npm run test -- -h

Gives-me:

npm run-script

Run arbitrary package scripts

Usage:
npm run-script <command> [-- <args>]

Options:
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
[-ws|--workspaces] [--if-present] [--ignore-scripts]
[--script-shell <script-shell>]

aliases: run, rum, urn

Run "npm help run-script" for more info

Expected Behavior

I expect that when i run npm run test -- -h, it gives me jest help info.

Steps To Reproduce

  1. NodeJs v16.2, npm v7.15.0
  2. A simple package with Jest as dependency and a script definition: "test": "jest"
  3. Run npm run test -- -h
  4. Not showing jest info

Environment

  • OS: Windows 10
  • Node: 16.2.0
  • npm: 7.15.0
@v1d3rm3 v1d3rm3 added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels May 30, 2021
@bruxisma
Copy link

bruxisma commented Jun 2, 2021

I'm also experiencing this same issue, using:

  • Powershell 7.1.3
  • Windows Terminal 1.7.1033
  • Node LTS 14.17.0
  • npm 7.15.0
  • Windows 10

@gregoryzh
Copy link

reported here too.
#3136
it's only powershell, bash or cmd works

@v1d3rm3
Copy link
Author

v1d3rm3 commented Jun 8, 2021

I have used powershell too, so it's the problem.

@wraithgar
Copy link
Member

Closing in favor of #3136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

4 participants