Skip to content

Conversation

@MaxBlack-dev
Copy link
Contributor

Description

This PR adds documentation about git version requirements for the npm version command.

Changes

  • Added a note to the npm-version.md documentation stating that git 2.0.0 or later is recommended
  • Advises users to check their git installation if they encounter issues

Fixes

Closes #2871

Context

Users with older versions of git (such as git 1.9.1) encountered cryptic errors when using npm version because npm uses git command options that were not available in older versions (specifically --porcelain=v1).

The maintainer noted that the resolution should be to provide more clear docs/messaging for unsupported versions of dependencies.

While npm implicitly requires a modern version of git for its version command to work properly, this was not documented anywhere. This PR adds a simple note to help users understand this requirement and troubleshoot issues more easily.

- Add note that git 2.0.0 or later is recommended for npm version
- Helps users troubleshoot issues with older git versions
- Addresses feedback from issue about cryptic errors with git 1.9

Fixes npm#2871
@MaxBlack-dev MaxBlack-dev requested a review from a team as a code owner December 3, 2025 02:03
@owlstronaut owlstronaut merged commit dd104da into npm:latest Dec 3, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants