I have a lerna repo for a project under development. It has several packages that depend on each other. To make development easier, none of the packages are published and they depend on the latest version of each other.
Directory tree
foo/
packages/
core/
package.json
errors/
package.json
foo/packages/core/package.json
{
...
dependencies: {
"@foo/errors": "*"
}
}
I have another project, bar
, that I'm using to test the lerna project. Currently I'm linking to its dependencies using a local file:
dependency:
bar/package.json
{
...
dependencies: {
"@foo/core": "../foo/packages/core"
}
}
This approach has given me a world of trouble.
- Using npm, I'm constantly hit with ENOENT .DELETE errors. Removing my package-lock.json and reinstalling has taken years off my life.
- Using yarn, I've been unable to
yarn install
inbar
. Yarn follows thefile:
dependency to@foo/core
, sees that it depends on@foo/errors
and doesn't know about lerna's symlink. This causes it to fail, telling me it can't find@foo/errors
.
This has made writing actual code for this project secondary to this mess of dependency management.
How can I make this (I feel fairly simple?) project structure work? Open to lerna/yarn/npm/pnpm/shell scripts/MS DOS at this point.
--hoist
helped a lot! – Grandam