lerna
Lerna is the original JavaScript monorepo management tool, providing utilities for managing multi-package repositories with optimized build pipelines, versionin…
Installation
npm install -D lerna
yarn add -D lerna
pnpm add -D lerna
Import
// lerna.json configuration
Quick Example
// 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
| Package | lerna |
| Category | Build Tool |
| Weekly Downloads | 2M+ |
| License | MIT |
| Install | npm install -D lerna |
Related Packages
Nx is a powerful build system with first-class monorepo support and powerful integrations that provi…
Turborepo is a high-performance build system for JavaScript and TypeScript monorepos that provides i…
Changesets is a tool for managing versioning and changelogs in multi-package repositories, focusing …
TypeScript is a strongly typed programming language that builds on JavaScript, adding static type de…
Browse npm Packages by Category
Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.