-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
Bugthing that needs fixingthing that needs fixingPriority 2secondary priority issuesecondary priority issue
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
If I have a git tag like v2.1.0-alpha.1 and I run npm version from-git --no-git-tag-version, it rewrites the tag's version to v2.1.0 and puts that into package.json's version property.
Expected Behavior
The prerelease stanza of the Git tag should be preserved when running npm version from-git. The current behaviour unexpectedly removes it. This led to a not-at-all-fun experience this morning due to inadvertently publishing a prerelease version as a stable version.
At the very least, this behaviour should be documented.
Steps To Reproduce
git tag v1.0.0-alpha.1npm version from-git --no-git-tag-version- The
versionproperty ofpackage.jsonwill now read1.0.0
Environment
- npm: 11.3.0
- Node.js: 22.15.0
- OS Name: circleci/[email protected]
- System Model Name: CircleCI
- npm config:
; node bin location = /usr/local/bin/node
; node version = v22.15.0
; npm local prefix = /home/circleci/project
; npm version = 11.3.0
; cwd = /home/circleci/project
; HOME = /home/circleci
; Run `npm config ls -l` to show all defaults.bnb
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingPriority 2secondary priority issuesecondary priority issue