Reputation: 380
I'm having some problems with yarn, on empty setups (when I do not have any versions of my libs on npm).
I've a multi-module project as structured bellow:
root # Yarn workspace
* packages
| * lib1-ws # Angular workspace
| | * projects
| | | * lib1
| | | * package.json
| | * package.json
| |
| * lib2-ws # Angular workspace
| | * projects
| | | * lib2
| | | * package.json # peer depends on lib1
| | * package.json # depends on lib1
| |
| * lib3-ws # Angular workspace
| * projects
| | * lib3
| | * package.json # peer depends on lib1
| * package.json # depends on lib1
|
* package.json
The projects lib2-ws and lib3-ws require lib1 to be build.
I was trying to release (install, build and publish) lib1 so that I can release lib2 and lib3.
But when I run yarn workspace lib1-ws install
or yarn install
(inside lib1-ws folder), yarn do try to install lib2-ws and lib3-ws as well, breaking the install operation with this error:
error Couldn't find package "lib1@^0.0.1" required by "[email protected]" on the "npm" registry.
Not sure what I'm missing, is there some command that I can run to ignore this workspace-aggregator
thing?
Thanks.
Upvotes: 7
Views: 2969
Reputation: 380
It seems that I did not searched enough, after post this question, I read another question that give-me an idea.
My workspaces object became like this:
"workspaces": {
"packages": [
"packages/*",
"packages/**/projects/*"
]
}
And it works, now I can install without even build or publish.
[UPDATE]
Because some angular build particularities, after install all dependencies, the empty setup must execute some order (because yarn workspace create symlinks for the libs):
build lib1 then publish lib1
yarn workspace lib2-ws add lib1@latest
yarn workspace lib3-ws add lib1@latest
build lib2 then publish lib2
build lib3 then publish lib3
After this steps, my libs are ready on my verdaccio local repository.
Upvotes: 2