Skip to content

[BUG] npm version command issuing invalid git command to check repository status #2871

@bcowgill

Description

@bcowgill

Current Behavior:

I am running the npm version command but it is issuing an invalid git command to check whether the repository is clean and therefore always fails.

Expected Behavior:

npm should either check the git version or issue an alternate --porcelain syntax to work properly with git, or report which version of git it requires to operate correctly.

Steps To Reproduce:

  1. In the environment shown below
  2. Run 'npm version patch -m "release Version patch %s, now with double cleaning action." '
  3. See error:
    npm ERR! code 129
    npm ERR! command failed
    npm ERR! command /usr/bin/git status --porcelain=v1 -uno
    npm ERR! error: option `porcelain' takes no value
    npm ERR! usage: git status [options] [--] ...
    npm ERR!
    npm ERR! -v, --verbose be verbose
    npm ERR! -s, --short show status concisely
    npm ERR! -b, --branch show branch information
    npm ERR! --porcelain machine-readable output

Environment:

  • OS: Ubuntu 14.04
  • Node: 12.19.0
  • npm: 7.5.6
  • git: 1.9.1

Note, when I run the command /usr/bin/git status --porcelain -uno
instead, it correctly shows the status of the repo so it seems npm is expecting some version of git without verifying that it has that version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Documentationdocumentation related issuecmd:versionrelated to `npm version`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions