[GENERAL QUERY] Managing Dependencies in a Yarn Berry Monorepo when running scripts from packages #6476
Unanswered
karthickshanmugam0689
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are currently in the process of migrating our private monorepo from yarn classic to yarn modern, specifically yarn pnp, in order to take advantage of the latest yarn features. Although this query may have been addressed in the past, I am seeking further clarification on dependency management with yarn berry.
Suppose we have a monorepo with the following structure, which has been migrated to yarn modern but not yet to pnp:
In this case, when running the build script from app1, the error "command not found: webpack" is displayed. After researching online, I discovered that this can be resolved by adding "run -T" to the build command, resulting in "run -T webpack mode --production". However, this solution would need to be added not only to commands using webpack, but to all commands that reference dependencies from the root level (e.g. tsc). Given that there are around 220 packages in this monorepo, this solution would be cumbersome.
Is there an alternative solution to this issue?
Beta Was this translation helpful? Give feedback.
All reactions