Skip to content

CLI usage with multiple arguments causes "error: too many arguments" #594

Closed
@metonym

Description

I have the following script:

"scripts": {
  "deploy": "gh-pages -d build -t true"
},

With gh-pages@6.2.0, running npm run deploy worked as expected.

However, with gh-pages@6.3.0, it now throws the following error:

npm run deploy

> gh-pages -d build -t true

error: too many arguments. Expected 0 arguments but got 1.

I believe this is due to a recent major version upgrade for commander (v11 --> v13). The breaking change only allows one argument by default. Subsequent arguments will throw the above error. For example, gh-pages -d build works fine.

One of the breaking changes in commander@13.0.0 is:

Breaking: excess command-arguments cause an error by default, see migration tips (#2223)

Source code of commander: file with breaking change.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions