Skip to content

fix: made lerna a peerDependency to avoid installing it multiple times #371

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

Conversation

sebinsua
Copy link

@sebinsua sebinsua commented Jun 18, 2018

Description

lerna@^2.9.0 should be a peerDependency (and for the purposes of the tests a devDependency) instead of a dependency.

Motivation and Context

This will avoid situations in which multiple versions of lerna get installed into a monorepo and it barfs when you try to run one of the commands (with "Incompatible local version of lerna detected!") due to your lerna.json#version not matching the version which has decided to run. (This sometimes happens if yarn has decided to install your packages into a slightly weird folder structure and the version of lerna which is being picked up is not the version that you installed within your root package.json.)

Usage examples

N/A

How Has This Been Tested?

I ran yarn test at the root of the monorepo.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@Sergiioo
Copy link

I've just hit this issue where I get the same incompatible lerna version warning after running yarn add @storybook/addon-knobs in a lerna monorepo project, so this PR would be really useful.

@sebinsua sebinsua mentioned this pull request Aug 10, 2018
7 tasks
@marionebl
Copy link
Contributor

Hey thanks for contributing - I think this is superseeded by #406.

@marionebl marionebl closed this Aug 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants