Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lerna Bootstrap Breaks When Using Yarn Version 2+ #2910

Open
Tracked by #4042
JPStrydom opened this issue May 20, 2021 · 5 comments
Open
Tracked by #4042

Lerna Bootstrap Breaks When Using Yarn Version 2+ #2910

JPStrydom opened this issue May 20, 2021 · 5 comments
Labels
scope: package management Issues with the bootstrap/add/link commands that relate to package management

Comments

@JPStrydom
Copy link

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
@Prior99
Copy link

Prior99 commented Jul 13, 2021

Did anyone manage to work around this issue or is there a replacement for lerna that can be recommended?

@merceyz
Copy link

merceyz commented Jul 15, 2021

You don't need to use lerna bootstrap with Yarn, all it does is shell out to Yarn anyways so running yarn install directly should be enough

@MirKml
Copy link

MirKml commented 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.

@matyasf
Copy link

matyasf commented Sep 25, 2021

Lerna 4.0's other commands (like version) are not compatible with yarn 2+, so its not a good idea to update.

@khusamov
Copy link

khusamov commented 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 '******'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: package management Issues with the bootstrap/add/link commands that relate to package management
Projects
None yet
Development

No branches or pull requests

7 participants