Lerna Bootstrap Breaks When Using Yarn Version 2+
See original GitHub issueExpected Behavior
Lthe Lerna bootstrap command should work with version 2 of Yarn.
Current Behavior
I get the following error when running lerna bootstrap
or yarn build
with version 2 of Yarn:
Unknown Syntax Error: Unsupported option name ("--mutex").
Possible Solution
Update the @lerna/bootstrap
module to use the version 2 Yarn install API.
Steps to Reproduce (for bugs)
In a project set up to work with Yarn version 1 workspaces and Lerna:
- Follow the Yarn v1 to v2 migration guide
- run
lerna bootstrap
- Watch it break
lerna.json
<!-- Please paste your `lerna.json` here -->
{
"useWorkspaces": true,
"version": "independent",
"npmClient": "yarn",
"command": {}
}
Context
Yarn version 1 takes almost an hour to install all our mono repo’s dependencies and bootstrap them. To remedy this we attempted to move to Yarn version 2 (due to its superior caching), which fixed a lot of our issues - but now the lerna bootstrap
command stopped working for us.
Your Environment
Executable | Version |
---|---|
lerna --version |
4.0.0 (also tested on 3.22.1 ) |
npm --version |
7.7.6 |
yarn --version |
2.4.1 |
node --version |
14.15.1 |
OS | Version |
---|---|
Windows 10 | 20H2 |
Issue Analytics
- State:
- Created 2 years ago
- Reactions:18
- Comments:5
Top Results From Across the Web
@lerna/bootstrap | Yarn - Package Manager
BREAKING CHANGES. prompt: The ambiguous 'confirm', 'select', and 'input' exports have been removed. Please use the renamed exports 'promptConfirmation', ' ...
Read more >lerna publish push to npm, but not updating dependencies
My Monorepo is currently managed by Lerna.js. It all works fine except for the GitHub actions workflow I use to automate the npm...
Read more >React Monorepo Using Yarn Workspaces Only (No Lerna)
“Lerna calls yarn install multiple times for each package which creates overhead because each package.json is considered independent and they can't share ...
Read more >Building Scalable Front-end With Lerna, YARN And React In ...
What most React projects are made of. 1 - Component Libraries 2 - Modules 3 - Utils libraries 4 - Abstractions over React-Redux...
Read more >lerna - Bountysource
Lerna Bootstrap Breaks When Using Yarn Version 2 + $ 0 ... Created 1 year ago in lerna/lerna with 0 comments. Expected Behavior....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As @merceyz mentioned, leave bootstrap up to package managers through workspaces. Use lerna only for automatic change detection, version management and publishing.
Lerna seems unmaintained and this approach can extends lerna usage with up to date tooling, until you prepare replacement.