Skip to content
Latchkey

Lerna "bootstrap" / Hoisting Failures in CI

A lerna bootstrap step failed - either because the command was removed in Lerna 7+ (install now happens via the package manager), or because a package’s install/lifecycle failed or hoisting created a conflict.

What this error means

lerna bootstrap errors with "command not found"/unknown command on Lerna 7+, or it runs but a package’s install/build script fails, or hoisted dependencies collide. CI that pinned an old Lerna workflow is the usual trigger.

Lerna output
lerna ERR! bootstrap This command has been removed.
lerna ERR! Use your package manager's workspaces install instead
lerna ERR!   (e.g. "npm ci" / "pnpm install --frozen-lockfile").

Common causes

bootstrap removed in Lerna 7+

Modern Lerna delegates installation to the package manager’s workspaces. lerna bootstrap no longer exists, so old CI scripts break after an upgrade.

A package lifecycle failed during bootstrap

On older Lerna, a failing postinstall/prepare in one package aborts the whole bootstrap.

Hoisting/symlink conflict

Hoisted dependencies or local symlinks can collide when two packages need incompatible versions, breaking the linked install.

How to fix it

Use workspaces install instead of bootstrap

On Lerna 7+, install with your package manager’s workspace-aware install; Lerna links via the lockfile.

Terminal
npm ci                     # npm workspaces
pnpm install --frozen-lockfile   # pnpm
yarn install --immutable         # yarn

Diagnose a failing package lifecycle

  1. Read which package’s script failed in the bootstrap output.
  2. Reproduce by installing/building that single package in isolation.
  3. For hoist conflicts, pin compatible versions or disable hoisting for the offending dep.

How to prevent it

  • On Lerna 7+, drop lerna bootstrap and use package-manager workspaces install.
  • Keep a committed lockfile so installs are reproducible in CI.
  • Avoid incompatible dependency versions that break hoisting.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →