New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An aliased package causes an unsolvable peer dependency warning #4301
Comments
If this works with Yarn and/or npm (when |
I think this issue may become more necessary with the complexity of frontend projects grows. If a project becomes too large and we want to upgrade a dependency (maybe a component library) by page, it's necessary to have different versions of one package, such as: # old version
pnpm i my-library@1
# old version, which has a peer dependency my-library
pnpm i my-hoc-library@1
# new version
pnpm i my-library-next@npm:my-library@2
pnpm i my-hoc-library-next@npm:my-hoc-library@2 In PNPM, it will print these errors, even if
And PNPM also generates the wrong content in A temporary way to fixCurrently I can fix my project by manually editing packages:
/my-hoc-library/2.0.0-xxxxxx:
dependencies:
- my-library: 1.0.0
+ my-library: /my-library/2.0.0-xxxxxx But this can be hard if the dependency graph is complex. 😢 |
PR #6220 should resolve this issue. In PNPM 7.29.3: After the PR: This should be considered a breaking change because it changes the way PNPM resolves peer dependencies and generate the |
close #4301 Co-authored-by: Zoltan Kochan <z@kochan.io>
pnpm version: 6.29.1
Code to reproduce the issue:
pnpm install
Expected behavior:
It should install without errors. (Because if we did
"webpack": "~5.68.0"
instead, it would install without errors.)Actual behavior:
The problem is that
terser-webpack-plugin
has a peer dependency onwebpack
which is normally satisfied bywebpack
. Butwebpack
has been renamed towebpack5
, so PNPM's validation considers the dependency to be unsatisfied.More details
In our case, the reason for aliasing the package is that we're developing a plugin that targets both Webpack 4 and Webpack 5:
Questions:
terser-webpack-plugin
's peer to be satisfied by thewebpack5
alias? I'm not sure whether this is solvable. (?)Additional information:
node -v
prints: 14.17.0The text was updated successfully, but these errors were encountered: