🔧
Build Tool2M+/wkMIT

lerna

Lerna is the original JavaScript monorepo management tool, providing utilities for managing multi-package repositories with optimized build pipelines, versionin

Installation

npm
npm install -D lerna
yarn
yarn add -D lerna
pnpm
pnpm add -D lerna

Import

ESM
// lerna.json configuration

Quick Example

usage
// lerna.json
{
  "packages": ["packages/*"],
  "version": "independent",
  "npmClient": "pnpm",
  "command": {
    "publish": {
      "conventionalCommits": true
    }
  }
}

About lerna

Lerna is the original JavaScript monorepo management tool, providing utilities for managing multi-package repositories with optimized build pipelines, versioning, and publishing workflows. Now maintained by Nx (Nrwl), Lerna has been revitalized with modern features including task caching, distributed task execution, and integration with Nx's computation caching. Lerna excels at coordinating versioning and publishing across multiple packages — it can bump versions, generate changelogs, create git tags, and publish to npm in a single command, handling the complex interdependencies between packages automatically. Lerna supports two versioning modes: fixed mode where all packages share a single version number, and independent mode where each package is versioned separately. The tool provides lerna run for executing scripts across packages in topological order, lerna exec for running arbitrary commands, and lerna bootstrap for linking local packages together during development. Lerna integrates with npm, yarn, and pnpm workspaces for package installation and linking. While Turborepo and Nx have become popular alternatives for task orchestration, Lerna remains the go-to tool for package versioning and publishing workflows in monorepos.

Quick Facts

Packagelerna
CategoryBuild Tool
Weekly Downloads2M+
LicenseMIT
Installnpm install -D lerna

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.