[chore] Configure lerna to use npm instead of yarn #740
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Looks like hoisting in lerna works with npm again, so I've switched back to using
npm
asnpmClient
. Hopefully this will improve overall stability and reduce the daily time spent waiting for the package manager to finish. I'm suspecting we may see a reduction in build times too, as hoisting means better deduping, but haven't tested.Also tweaked a few other flags, e.g. using
npm ci
when applicable.Some unscientific tests from running on my mac:
Bootstrapping after git clone (no lockfiles)
⑂ next$ time yarn 8.12s user 11.56s system 127% cpu 15.458 total
⑂ lerna-use-npm$ time npm i 33.79s user 18.62s system 201% cpu 26.017 total
⑂ next$ time yarn run bootstrap 174.65s user 272.09s system 170% cpu 4:21.27 total
⑂ lerna-use-npm$ time npm run bootstrap 75.83s user 56.97s system 209% cpu 1:03.49 total
Cleaning
⑂ next$ time yarn run clean 54.27s user 510.33s system 569% cpu 1:39.17 total
⑂ lerna-use-npm$ time npm run clean 18.45s user 5.35s system 325% cpu 7.310 total
(note: this reduction is largely due to dependencies being hoisted to root node_modules)
⑂ next$ time rm -Rf node_modules 0.05s user 1.88s system 99% cpu 1.942 total
⑂ lerna-use-npm$ time rm -Rf node_modules 0.18s user 8.33s system 94% cpu 8.993 total
After repo has been cleaned
⑂ next$ time yarn 5.82s user 11.60s system 236% cpu 7.381 total
⑂ lerna-use-npm$ time npm i 25.51s user 26.28s system 167% cpu 30.946 total
(
npm ci
can safely be run when there's a lockfile)⑂ next$ time yarn run bootstrap 175.29s user 271.84s system 172% cpu 4:19.28 total
⑂ lerna-use-npm$ time npm run bootstrap 73.41s user 54.27s system 206% cpu 1:01.71 total
Bootstrap after add new dependency in a package
⑂ next$ time yarn run bootstrap 7.98s user 1.81s system 55% cpu 17.635 total
⑂ lerna-use-npm$ time npm run bootstrap 30.25s user 3.29s system 100% cpu 33.305 total