[BUG] `npm version` command does not respect `config set tag-version-prefix ""` since >= v9.6.5
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.1k
- Forks
- 4.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 19
Description
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
Despite explicitly using npm config set tag-version-prefix "" before npm version <patch|minor|major>, the created git tag and resulting function output are still prefixed with v.
This behavior occurs in NPM v9.6.5 -> v9.8.1
Expected Behavior
Up until npm v9.6.5, when using npm config set tag-version-prefix "", the created git tag, git commit message and command output would all result in the new version without the v prefix.
Steps To Reproduce
- Create a new empty NPM project with
npm init -y && git init - Run
npm config set tag-version-prefix "" - Run
npm versionwith eithermajor,minororpatch - Observe command output with
vprefix - Check git tags with
git tag --listand observe created tag withvprefix - Check git commit logs with
git logand observe commit message of new version, withoutvprefix
Environment
- npm: >= v9.6.5
- Node.js: >= 18.16.0
- OS Name: MacOS Ventura 13.4/Ubuntu 22.04.3
- System Model Name: Macbook Pro 2019/GitHub Actions Runner 2.308.0
- npm config:
; "user" config from /Users/calem.roelofs/.npmrc
//npm.pkg.github.com/:_authToken = (protected)
; node bin location = /Users/calem.roelofs/.nvm/versions/node/v18.16.0/bin/node
; node version = v18.16.0
; npm local prefix = /Users/calem.roelofs/Code/CalemRoelofs/testversion
; npm version = 9.6.5
; cwd = /Users/calem.roelofs/Code/CalemRoelofs/testversion
; HOME = /Users/calem.roelofs
; Run `npm config ls -l` to show all defaults.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in an empty npm project using npm config set tag-version-prefix "" followed by npm version patch, minor, or major. Compare the command output, created Git tag, and commit message with the expected unprefixed version. The payload does not name a source file or test, so locating the versioning and tag-prefix handling will require repository research.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli, release
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100