lerna: Error running `lerna updated`

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)

Any idea what could be wrong?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 26 (16 by maintainers)

Commits related to this issue

Most upvoted comments

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

Also I want to note that all my tags are annotated:

bash-3.2$ git tag -n99
case-results-service@0.2.0 case-results-service@0.2.0
case-results-service@0.3.0 case-results-service@0.3.0
case-results-service@1.0.0 case-results-service@1.0.0
case-results-service@2.0.0 case-results-service@2.0.0
results-service@2.0.0 results-service@2.0.0
results-service@3.0.0 results-service@3.0.0
sekeleton       chore: First commit + skeleton
v1.0.0          First version

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

Ditto on 2.0.0

Is this considered to be fixed ? I’m facing the exact same issue on 2.0.0-rc.5

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.

¯\_(ツ)_/¯

@danielo515 I was getting this error when I was trying to run lerna update in master, where I didn’t have any tag. I actually had a previous tag in a branch.

To fix it, I created manually a tag in master. After that, lerna update started working.

To create a tag manually, use something like @yourscope/packagename@0.0.1-alpha.1

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 updated for you.