Reputation: 679
have added lerna to my project, i have added a package to my server by running this command successfully:
lerna add @types/express --dev
But when I want to add another one:
lerna add graphql class-validator type-graphql
I got this error :
info cli using local version of lerna
lerna notice cli v3.22.1
lerna WARN No packages found where graphql can be added.
yarn add
instead of leran add
? looks it works but I doubt about the packages tree form to be correctUpvotes: 13
Views: 12089
Reputation: 2048
Old question, but I ran into the same issue with "lerna": "^5.5.2"
trying to only install a single dependency.
Ran lerna repair --verbose
and it highlighted issues with the version of Nx. Once fixed I could install deps again. Granted, you might not have Nx integrated, but the repair command will give you more insights into what could potentially be the issue.
As per @Domi's answer Lerna's CLI is still not very forthcoming with feedback.
Upvotes: 0
Reputation: 24638
Foreword: The lerna
cli
is notoriously bad at giving feedback. You get weird errors and warnings that don't seem to make a lot of sense in the context.
I identified the following causes (at one point or another) to all result in this error message:
yarn
and npm
you can (force) re-install a package, instead of having it error out.npx lerna add --scope=... packageA packageB
Upvotes: 4
Reputation: 1447
At the moment, lerna doesn't support adding multiple packages to another package like so:
❌ lerna add '@my-company/{utils,types}' --scope '@my-company/ui'
// We have to do this instead
lerna add '@my-company/utils' --scope '@my-company/ui'
lerna add '@my-company/types' --scope '@my-company/ui'
Lerna does support adding 1 package into multiple packages though:
lerna add '@my-company/utils --scope '@my-company/{ui,data}'
lerna's github discussion on this issue for updates (link)
Upvotes: 15