-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] npm version does not commit and tag without .git dir in cwd #3803
Comments
Do you have an .npmrc or any env vars that might be affecting npm’s config? |
Also, npm 7.10 is old, can you try with the latest v7? |
Hello, I have an
The package is not at the root of the repo. Does f.e. the repo is like this:
and |
I doubt it - unless you're using npm workspaces, it should always find the closest package.json. what does |
I edited my previous comment (in case you have to refresh) to show the repo layout. I'm not using workspaces.
( |
We need to do this for now because while packages/lume/ is not at the root of the repo, then `npm version` will not commit and tag like it normally does. npm/cli#3803
Here is a reproduction: git clone https://github.com/lume/lume.git
cd lume/packages/lume
npm version major -m "v%s" --ignore-scripts After this, you will see that package.json was updated, but no commit or tag was created. |
Is there a way to force it to commit and tag? |
Hey @trusktr, And this makes sense to me, because if you increment the version of the subfolder, it isn't a bump in your package.json at the root of your project, correct? So it shouldn't tag/commit since the entire package/folder/repo wasn't versioned. I would suggest to host your package |
Hmm. This issue makes working with This means I can't re-use this release process unless I move lume to the root, or to a new repo like you suggested (either of those options has a downside, like messing with how Lerna works, or moving code away from the main repo with all the original commit history, etc). It would be great if an explicit passing of Longer term, I do believe that having the main package at the root of a repo would make most sense. This is just how things are at the moment. |
Since you raised this bug on npm v7.10 and I've tried this with v7.24.1, has this worked before? On some previous version of npm maybe? If you could find that out, I'd be more than happy to take a look at what changed and see if it was an intended change. |
I haven't had time to look at that, but I ended up moving the project to the top level of my repo, and luckily that worked out with Lerna, so the npm publish process works as expected now in that case. |
I believe this is the same issue causing |
Is there an existing issue for this?
Current Behavior
I run
npm version
and no commit or tag is created. I am not using--no-git-tag-version
. F.e. justnpm version major -m "..."
.Under what conditions does
npm version
avoid creating a commit and tag?Expected Behavior
Always commit and tag unless I specify not to.
Steps To Reproduce
After this, you will see that
package.json
was updated, but no commit or tag was created.Environment
The text was updated successfully, but these errors were encountered: