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
Dependency deduplication seems not to work #7105
Comments
One more reproduction with PNPM 8.8.0 and nodejs 20.5.1 on Linux: git clone https://github.com/gentoo90/pnpm-dedupe-bug-repro
pnpm i
pnpm build It's an empty Angular 16 project with a custom webpack config that uses function readPackage(pkg, context) {
if (pkg?.name == 'webpack-manifest-plugin') {
context.log(`Fixing dependencies of ${pkg.name}`);
pkg.peerDependencies['esbuild'] = '0.18.17';
}
return pkg;
}
module.exports = {
hooks: {
readPackage,
}
}; |
I think #7163 is the same issue |
We do have the same issue in a big NestJS monorepo. A clean install with |
Probably #6605 has reintroduced the problem in |
@zkochan is there a chance to get multiple copies of same deps fixed? |
This is not high priority right now. You can install In any case, The easiest way to fix this would be probably to use dependencies from any workspace projects, when resolving peer dependencies (not just dependencies of the real dependent workspace project). |
Verify latest release
pnpm version
8.7.6
Which area(s) of pnpm are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue or a replay of the bug
https://github.com/pmb0/pnpm-peer-deduplication-not-working/tree/main
Reproduction steps
git clone https://github.com/pmb0/pnpm-peer-deduplication-not-working
pnpm i
pnpm test
Describe the Bug
When using NestJS dependencies in own monorepo libs,
@nestjs/core
is installed multiple times, which leads to runtime errors in NestJS.pnpm dedupe
anddedupe-peer-dependents=true
seem to have no effect. This problem occurred in the past but not inpnpm@8.6.0
and after upgrading to any version after8.6.0
it reappeared.As far as I know, the problem can only be solved by installing the NestJS dependencies in the root package (
resolve-peers-from-workspace-root=true
), which is a workaround.Expected Behavior
NestJS dependencies such as
@nestjs/platform-express
define their dependencies as follows:If my own libs do the same, I expect only one copy of
@nestjs/core
to exist afterwards.Which Node.js version are you using?
v18.16.0
Which operating systems have you used?
If your OS is a Linux based, which one it is? (Include the version if relevant)
No response
The text was updated successfully, but these errors were encountered: