You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm trying to run lerna on an existing monorepo. I've run lerna bootstrap without issues, but I'm seeing this error when running lerna updated:
Checking packages...
fatal: No annotated tags can describe 'af2c265fda2e7a93c4f6881b747e6f398d4e7c8d'.
However, there were unannotated tags: try --tags.
child_process.js:484
throw err;
^
Error: Command failed: git describe af2c265fda2e7a93c4f6881b747e6f398d4e7c8d
fatal: No annotated tags can describe 'af2c265fda2e7a93c4f6881b747e6f398d4e7c8d'.
However, there were unannotated tags: try --tags.
at checkExecSyncError (child_process.js:441:13)
at Object.execSync (child_process.js:481:13)
at execSync (/usr/local/lib/node_modules/lerna/lib/commands/updated.js:63:16)
at Object.exports.checkUpdatedPackages (/usr/local/lib/node_modules/lerna/lib/commands/updated.js:30:23)
at Object.exports.execute (/usr/local/lib/node_modules/lerna/lib/commands/updated.js:9:33)
at Object.<anonymous> (/usr/local/lib/node_modules/lerna/bin/lerna.js:41:9)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
I just checked the provided link, and it's something I already did. My repo one has two tags, the oldest one which is non annotated and another one which is annotated. Lerna update does not fail, but it does the publish
This is still happening randmoly.
I have several annotated tags created by lerna (using lerna publish). I have added a couple of commits and run lerna publish and now it fails again with the same error. This never happened to me before, I can't understand what is wrong.
Ok, here I am again with a bit more of information.
Seems that having the current branch unpublished to the remote makes this error to trigger. I don't see why this happens at all, but it happens. Maybe it's because lerna makes the assumption that I want to publish changes to the remote repository, and it does not check if that is possible beforehand to provide an useful error message.
I have published the branch and now it works, but sadly lerna now says that there is no package to update, which is not true. How can I say to lerna what is the correct tag to compare with ?
Here I am wit some (I hope) more useful information.
I just made a small change to a file (the version on the package.json) and now lerna detects the changes correctly and proposes the proper updates (I'm using conventional-changelog).
So in summary
If you are in a non-published branch, lerna will fail on publish or checking updated with the "no tag can describe " error
If you publish that branch later (after all the work is done ) lerna will not detect any change
If you made any change from that point, everything works fine again.
Hope that summary helps lerna developers to improve the tool or any other person facing this problem
In my opinion this issue should be reopened. The bug exists and it's well documented and it is also very annoying.
Even if you don't want to bug the root cause of the problem it would be ideal to provide any fallback mechanism. Maybe allowing to create a manual named tag using lerna or whatever we came up with
Reacted by Laura, Konstantin Nesterov, Chad Ostrowski, chunming, chen and Brian Takita
So I'm a bit on a dead end here: all my tags are annotated, but I can not create a new tag because the current sha is not an annotated tag.
I don't know what lerna actually expects and why this fails randomly
Reacted by Seb Insua, Chad Ostrowski and Choon-ho Yoon
@rufman I can assert with 100% confidence that lerna publish does create annotated tags. It has been over a year since that functionality was released.
@evocateur when I ran lerna publish and then lerna updated the tag that was being referenced was not the tag that was just created, but an earlier one (an annotated tag from before the repo used lerna).
On Jul 6, 2018, at 15:32, Stephane Rufer ***@***.***> wrote:
@evocateur when I ran lerna publish and then lerna updated the tag that was being referenced was not the tag that was just created, but an earlier one (an annotated tag from before the repo used lerna).
Checking out the code it seems that there is no -a option in the tag command here: https://github.com/lerna/lerna/blob/master/commands/publish/lib/git-tag.js#L11
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
I tried it again (without --tags) & the error is gone after publishing the packages (with --tags). Publish seems good as well. Not sure why it's working or why it didn't work before.
ISTR that there was a tag created by oao, but I'm not sure if that caused the problem.
Maybe the tag created by oao was in a format that lerna did not expect (e.g. v2.0.4)
It probably wasn't annotated, which explains why git describe missed it. Lightweight tags are not appropriate to use for release tags, as documented:
Tag objects (created with -a, -s, or -u) are called "annotated" tags; they contain a creation date, the tagger name and e-mail, a tagging message, and an optional GnuPG signature. Whereas a "lightweight" tag is simply a name for an object (usually a commit object).
Annotated tags are meant for release while lightweight tags are meant for private or temporary object labels. For this reason, some git commands for naming objects (like git describe) will ignore lightweight tags by default.
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Activity
hzoo commentedon Jan 20, 2016
Not sure, I extracted out what
lerna publishwas doing.It looks like it is erroring on line 30.
git describe sha-numberAfter reading stack overflow, it looks like
git describeonly usesannotated tagsby default and I guess none of the tags in the repo are annotated.It looks like we could potentially do
git describe --tagsand it would work. @kittens?Yeah that's probably it since we do that above that
pass in `--tags` argument to git describe
pass in `--tags` argument to git describe
danielo515 commentedon Jun 29, 2017
Is this considered to be fixed ? I'm facing the exact same issue on
2.0.0-rc.5nevir commentedon Jul 8, 2017
Ditto on 2.0.0
danielo515 commentedon Sep 1, 2017
Well, here I am again, facing this problem at 2.0.0
evocateur commentedon Sep 1, 2017
v2.0.0+ uses (and creates) annotated git tags. I'm fairly certain it was changed in one of the release candidates. https://stackoverflow.com/questions/5002555/can-a-lightweight-tag-be-converted-to-an-annotated-tag#5002886 describes how to migrate your last lightweight tag, which should then fix
lerna updatedfor you.danielo515 commentedon Sep 1, 2017
Thanks @evocateur,
I'll check that link. For me it is failing on publish with
--skip-npmon a brand new repodanielo515 commentedon Sep 1, 2017
I just checked the provided link, and it's something I already did. My repo one has two tags, the oldest one which is non annotated and another one which is annotated. Lerna update does not fail, but it does the publish
danielo515 commentedon Sep 12, 2017
This is still happening randmoly.
I have several annotated tags created by lerna (using lerna publish). I have added a couple of commits and run lerna publish and now it fails again with the same error. This never happened to me before, I can't understand what is wrong.
Any help will be appreciated
Regards
danielo515 commentedon Sep 12, 2017
Ok, here I am again with a bit more of information.
Seems that having the current branch unpublished to the remote makes this error to trigger. I don't see why this happens at all, but it happens. Maybe it's because lerna makes the assumption that I want to publish changes to the remote repository, and it does not check if that is possible beforehand to provide an useful error message.
I have published the branch and now it works, but sadly lerna now says that there is no package to update, which is not true. How can I say to lerna what is the correct tag to compare with ?
danielo515 commentedon Sep 12, 2017
Here I am wit some (I hope) more useful information.
I just made a small change to a file (the version on the package.json) and now lerna detects the changes correctly and proposes the proper updates (I'm using conventional-changelog).
So in summary
Hope that summary helps lerna developers to improve the tool or any other person facing this problem
Regards
danielo515 commentedon Sep 20, 2017
In my opinion this issue should be reopened. The bug exists and it's well documented and it is also very annoying.
Even if you don't want to bug the root cause of the problem it would be ideal to provide any fallback mechanism. Maybe allowing to create a manual named tag using lerna or whatever we came up with
danielo515 commentedon Sep 20, 2017
Also I want to note that all my tags are annotated:
So I'm a bit on a dead end here: all my tags are annotated, but I can not create a new tag because the current sha is not an annotated tag.
I don't know what lerna actually expects and why this fails randomly
1 remaining item
askz commentedon Feb 9, 2018
Other solution is to merge tag with
git merge <tag>rufman commentedon Jul 6, 2018
This seems broken again.
publishdoes not create an annotated tag, butupdatedonly looks for annotated tags.evocateur commentedon Jul 6, 2018
@rufman I can assert with 100% confidence that lerna publish does create annotated tags. It has been over a year since that functionality was released.
rufman commentedon Jul 6, 2018
@evocateur when I ran
lerna publishand thenlerna updatedthe tag that was being referenced was not the tag that was just created, but an earlier one (an annotated tag from before the repo used lerna).Checking out the code it seems that there is no
-aoption in the tag command here: https://github.com/lerna/lerna/blob/master/commands/publish/lib/git-tag.js#L11evocateur commentedon Jul 6, 2018
btakita commentedon Aug 2, 2018
I'm trying lerna for the first time. I'm running into the same error.
I'm really confused over how lerna is supposed to work. Sorry if this is not helpful, but it would be great to understand what's going on.
¯\_(ツ)_/¯btakita commentedon Aug 2, 2018
Could this be the culprit?
https://github.com/lerna/lerna/blob/master/utils/collect-updates/collect-updates.js#L30
I changed the line to and it seems to work:
`git describe --tags --abbrev=0` instead of `git describe --abbrev=0`
evocateur commentedon Aug 3, 2018
@btakita No,
--tagsis only necessary when you need to also match "lightweight" tags, which is not what lerna publish creates, I can assure you.btakita commentedon Aug 3, 2018
I tried it again (without
--tags) & the error is gone after publishing the packages (with--tags). Publish seems good as well. Not sure why it's working or why it didn't work before.ISTR that there was a tag created by
oao, but I'm not sure if that caused the problem.Maybe the tag created by
oaowas in a format that lerna did not expect (e.g.v2.0.4)evocateur commentedon Aug 3, 2018
It probably wasn't annotated, which explains why
git describemissed it. Lightweight tags are not appropriate to use for release tags, as documented:geekplux commentedon Sep 7, 2018
same error here. using lerna in an existing project.
evocateur commentedon Sep 8, 2018
@geekplux If you can provide more details and a consistent reproduction of your error, please open a new issue. Thanks!
lock commentedon Dec 27, 2018
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.