-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Current Behavior:
npm version <version>
is not committing the modified package.json or package-lock.json; nor git-tagging.
We were using npm version {major|minor|patch}
extensively (and successfully). It stopped working once the package was moved out of the root of the repo and into a subdirectory.
Expected Behavior:
npm version <version>
should continue to create a git-commit and git-tag as indicated in the docs:
If run in a git repo, it will also create a version commit and tag. This behavior is controlled by git-tag-version (see below), and can be disabled on the command line by running npm --no-git-tag-version version. It will fail if the working directory is not clean, unless the -f or --force flag is set.
Steps To Reproduce:
- initialize an npm package in the root of an initialized git repo
npm version minor
successfully bumps the version, commits and tags- move the npm package into a subdirectory of the repo
npm version minor
still bumps the version in package.json and package-lock.json, but git is not committed nor tagged.
Environment:
- macOS 10.15.7
- node: v14.13.1
- npm: 6.14.8
- git: git version 2.28.0
This is apparently an existing bug going as far back as npm v3: npm/npm#18795