Trying to execute lerna run --parallel on a set of packages
Asked Answered
D

3

5

I am using lerna to manage my mono repo.

I'd like to run a command in parallel towards a set of packages.

I tried the following but can't get it working:

lerna run start --parallel packages1 packages2
lerna run start --parallel --scope packages1 packages2
lerna run start --scope "packages1 packages2" --parallel

It doesn't execute "run start" on my scope but on all the packages I have.

What is the right syntax to define the scope? Couldn't find anything in the documentation for that.

Thanks.

Divaricate answered 6/10, 2017 at 11:4 Comment(0)
G
14
lerna run start --parallel --scope packages1 --scope packages2

should work.

According to their docs,

lerna run start --parallel --scope packages*

should also work, assuming you don't have a packages3 and packages4 that you don't want to run.

Gatekeeper answered 13/1, 2018 at 19:42 Comment(1)
If your packages have the same prefix you can say --scope @myrepo/{pkg1,pkg2}Nava
B
0

Did You specify the pathes of your packages in lerna.json ? Example:

{
  "packages": [
    "packages/*",
    "package1",
    "package2"
  ],
  "npmClient": "yarn",
  "version": "0.0.0"
}

Here for more informations

Blotter answered 14/1, 2022 at 9:21 Comment(0)
A
-1
lerna run start --parallel '{*/packge,*/packge2,*/package3,*/package4,*/package5}'
Actinon answered 8/9, 2021 at 10:3 Comment(1)
Please provide additional details in your answer. As it's currently written, it's hard to understand your solution.Perianth

© 2022 - 2024 — McMap. All rights reserved.