question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lerna Bootstrap Breaks When Using Yarn Version 2+

See original GitHub issue

Expected 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:

  1. Follow the Yarn v1 to v2 migration guide
  2. run lerna bootstrap
  3. 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:open
  • Created 2 years ago
  • Reactions:18
  • Comments:5

github_iconTop GitHub Comments

1reaction
MirKmlcommented, Aug 29, 2021

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.

0reactions
khusamovcommented, Apr 1, 2022
$ lerna bootstrap
info cli using local version of lerna
lerna notice cli v4.0.0
lerna info versioning independent
lerna info bootstrap root only
Unknown Syntax Error: Unsupported option name ("--mutex").

$ yarn install [--json] [--immutable] [--immutable-cache] [--check-cache] [--inline-builds] [--mode #0]
lerna ERR! yarn install --mutex network:42424 --non-interactive exited 1 in '******'
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found