0

When I run lerna bootstrap, according to the docs:

Usage

$ lerna bootstrap
Bootstrap the packages in the current Lerna repo. Installs all of their dependencies and links any cross-dependencies.

When run, this command will:

npm install all external dependencies of each package.
Symlink together all Lerna packages that are dependencies of each other.
npm run prepublish in all bootstrapped packages (unless --ignore-prepublish is passed).
npm run prepare in all bootstrapped packages.

Since bootstrapping has nothing to do with publishing, why does it run prepublish? Why is it the default?

Nick
  • 11,483
  • 8
  • 41
  • 44

1 Answers1

8

Because npm install also triggers the prepublish script. If you want your prepublish scripts not to be triggered use the prepublishOnly script instead. You can read all about this in the NPM script documentation

dlac
  • 315
  • 2
  • 9