Forrest logo
back to the lerna tool

lerna:tldr:25836

lerna: Install all external dependencies of each package and symlink together local dependencies.
$ lerna bootstrap
try on your machine

The lerna bootstrap command is used in a monorepo (a repository that contains multiple packages) managed by Lerna to set up the development environment for all the packages.

When executed, lerna bootstrap does the following:

  1. It analyzes the dependencies of the packages in the monorepo to determine the correct installation order.
  2. It installs all the necessary dependencies for each package in the monorepo using the package manager specified in the root package.json file (such as npm or Yarn).
  3. It links together any cross-dependencies between packages within the monorepo. This means that instead of installing duplicate copies of the same dependency in multiple packages, it creates symbolic links that allow the packages to share a single copy of the dependency installed at the root level.
  4. It runs the prepack scripts defined in each package's package.json, if any.
  5. It runs the prepare scripts defined in each package's package.json, if any.
  6. Finally, it prints a summary of which packages were bootstrapped, installed, and linked.

Overall, lerna bootstrap helps to simplify the setup process for a monorepo by automatically handling the installation and linking of dependencies across multiple packages.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the lerna tool