![Forrest logo](/images/logo.png)
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:
- It analyzes the dependencies of the packages in the monorepo to determine the correct installation order.
- 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). - 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.
- It runs the
prepack
scripts defined in each package'spackage.json
, if any. - It runs the
prepare
scripts defined in each package'spackage.json
, if any. - 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.