pnpm version: 7.32.0
This is a reproducible demo: demo
description:
- In the demo project, for some reasons, I have to use react@16.9.0, and there is also a package called @wuerkang/test_package.
- @wuerkang/test_package is the test package I created, which depends on ink and ink-spinner. Both packages have react as a peer dependency, and ink-spinner also has ink as a peer dependency. I expect them to use react@17.0.2
/* package.json of @wuerkang/test_package */
{
"name": "@wuerkang/test_package",
"dependencies": {
"react": "17.0.2",
"ink": "3.2.0",
"ink-spinner": "4.0.3"
}
}
Expected behavior:
Install react@16.9.0 in the project's root directory, and ink package can correctly reference react@17.0.2
Actual behavior:
When auto-install-peers=false, the installation result meets expectations; but when auto-install-peers=true, ink incorrectly references react@16.9.0 instead of 17.0.2. At the same time, a warning log appears in the console:
.
└─┬ @wuerkang/test_package 1.0.5
└─┬ ink 3.2.0
└─┬ react-reconciler 0.26.2
└── ✕ unmet peer react@^17.0.2: found 16.9.0
question:
Is there a way to automatically install unmet peers?
Is it true that we have no control over the versions of peerDependencies for deeply nested packages?
Or how to set configuration in the above scenario to meet my needs?
Looking forward to your answer,thanks!