Slow build times when running `lerna run build` from root of lerna project
See original GitHub issueI opened an issue in another library(TSDX) I’m using to handle Typescript configuration in a small React + Typescript component library set up as a monorepo (using lerna). Build times always took a couple minutes but after upgrading TS versions they take noticeably longer. This all sounds like issues related to the bundler, but when I run npm run build
from within each package build times aren’t long at all (a few seconds for one, and less than a minute for the other). Then when I go run lerna run build
from the root of my package the build times are 6x slower.
tl;dr: My issue is painfully slow build times from running the build
command in each package via lerna run build
which is odd since running npm run build
from each package doesn’t result in long build times.
Is there a configuration I’m not aware of that should be initialized inside of lerna.json
? I’m not using yarn workspaces. I use npm. I’ve seen a few threads mention things about workspaces. Is there a npm counterpart for workspaces that might resolve this issue? Not sure how I would even debug this issue.
Your Environment
Lerna monorepo using TSDX to configure each React-based Typescript package.
Executable | Version |
---|---|
lerna --version |
3.16.4 |
npm --version |
6.12.0 |
node --version |
v12.13.0 |
OS | Version |
---|---|
macOS Sierra | 10.13.5 |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:9
Top GitHub Comments
My colleague found the problem. We are behind a corporate proxy. Every new process tries to run
update-notifier
which does not support proxies. Lerna is waiting until update-notifier finished before it runs the next command. You can create an entry in your .nmprc file withupdate-notifier=false
. At least this is what has helped us.I’m seeing this as well. Very slow builds from root dir using lerna. This wasn’t the case until recently…
Is there some cache file or something somewhere that might need to be purged?
Setting update-notifier=false had no effect.