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

use local lerna if global lerna used as entry point #735

Closed
cdaringe opened this issue Apr 6, 2017 · 6 comments
Closed

use local lerna if global lerna used as entry point #735

cdaringe opened this issue Apr 6, 2017 · 6 comments

Comments

@cdaringe
Copy link
Contributor

cdaringe commented Apr 6, 2017

hi all,

would you accept a PR that uses the local version of lerna (if found) when the global lerna is the cmd entry point?

Expected Behavior

  • allow global lerna to use local lerna if it exists
    • allow lerna <cmd> to work vs ./node_modules/.bin/lerna <cmd>

examples:

Current Behavior

no such functionality exists, ref

@evocateur
Copy link
Member

I'm a little confused why you would need this, if you already have lerna globally available?

@cdaringe
Copy link
Contributor Author

cdaringe commented Apr 7, 2017

Different projects, different lerna versions. Iirc some lerna versions make sure that the running version matches that listed in the lerna.json. peace of mind that the version that is running is always what is declared regardless of what shenanigans I'm doing globally. I've always loved that feature of webpack

@evocateur
Copy link
Member

I've found calling lerna from root package.json scripts to be more than sufficient for isolating a particular version. #694 makes the version check only complain about insufficient semver (usually major version mismatch or older lerna attempting to work on "newer" repo).

For example, run lerna bootstrap in the postinstall lifecycle, and you only need to run npm install (or yarn, if you're fancy) and it will always call the local lerna:

  "name": "my-lerna-monorepo",
  "private": true,
  "scripts": {
    "postinstall": "lerna bootstrap",
    "test": "lerna run test"
  },
  devDependencies: {
    "lerna": "^2.0.0-rc.0"
  }
}

@hzoo
Copy link
Contributor

hzoo commented Apr 7, 2017

yeah same request was made to Babel babel/babel#5091

@evocateur
Copy link
Member

Closing this as a duplicate of #138

@lock
Copy link

lock bot commented Dec 28, 2018

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants