Skip to content

[BUG] Single -- separator fails to pass arguments to npm script in version 10.9.0 #7880

@leebailey88

Description

@leebailey88

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

Instead of executing the mtm script with the specified arguments, npm outputs the current version (10.9.0) and exits.

Workaround

npm run mtm -- -- -l 1 -s 0 -h 160000 -f vix/vix-ta-macro-advanced --vix --bci --seasonal --cpi --effr --bond10 --bond2 --aaii --m2 --cape --fileToSheetName -v

Expected Behavior

Running the following command should execute the mtm script in package.json with the provided arguments:

npm run mtm -- -l 1 -s 0 -h 160000 -f vix/vix-ta-macro-advanced --vix --bci --seasonal --cpi --effr --bond10 --bond2 --aaii --m2 --cape --fileToSheetName -v```

### Steps To Reproduce

### Steps to Reproduce
1. Create an `mtm` script in `package.json`:
   ```json
   {
     "scripts": {
       "mtm": "node path/to/your-script.js"
     }
   }
  1. Run the command with arguments after a single -- separator:
    npm run mtm -- -l 1 -s 0 -h 160000 -f vix/vix-ta-macro-advanced --vix --bci --seasonal --cpi --effr --bond10 --bond2 --aaii --m2 --cape --fileToSheetName -v
  2. Observe that npm prints its version instead of executing the script with the arguments.

Additional Notes

This behavior change only started after upgrading to npm 10.9.0; the command worked correctly on 10.8.0. This change may be a bug or a new feature, but it’s currently undocumented.

Environment

Environment

  • npm version: 10.9.0
  • Node.js version: 20.11.0
  • Operating system: Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingDuplicateduplicate of another, existing issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions