#3115·lerna

lerna ERR! EBEHIND Local branch 'master' is behind remote upstream origin/master

Author: sachin0903Created Apr 28, 2022Updated Jun 8, 2026

We are experiencing following error when running lerna in Jenkins and the when people merge their code into master while there is an active build in progress.

lerna notice cli v3.19.0 lerna info versioning independent lerna ERR! EBEHIND Local branch 'master' is behind remote upstream origin/master lerna ERR! EBEHIND Please merge remote changes into 'master' with 'git pull'  ERROR  Command failed with exit code 1.  ERROR  Command failed with exit code 1.

I like to know how to handle this scenario. Is lerna version or publish not meant to be running in CI pipeline?

Possible Solution

I like to hear from the people here.

Steps to Reproduce (for bugs)

  1. Merge PR A to main (which will trigger pipleine)
  2. Merge PR B to main
  3. pipeline for PR A fails with error EBEHIND
lerna.json

json
{
  "command": {
    "publish": {
      "conventionalCommits": true,
      "message": "chore(release): publish",
      "registry": "https://path.to.registry/npm/registry/"
    }
  },
  "npmClient": "pnpm",
  "packages": ["packages/*"],
  "version": "independent"
}

Context

Your Environment

| Executable | Version | | lerna | 3.19.0 | | npm | 8.1.2 | | node | 16.13.0 |