Two packages you depend on disagree about a peer version
Commonpackage.json asks for a version of one package that another package's peer range excludes, as react 18 with react-dom 17 does. Often one of them was upgraded without the other.
Confirm
npm view <package>@<version> peerDependencies
Run it for the package named after from in the Could not resolve line. A range that excludes the version shown after Found confirms it
Fix
- Find a version of the declaring package whose peer range includes what you have: npm view <package>@latest peerDependencies, then older or newer versions as needed.
- Or move the other package to a version inside the range, if that is the one that drifted.
- Upgrade them in the same change so the lockfile never holds the mismatched pair.
npm view react-dom@18.3.1 peerDependencies npm install react-dom@18.3.1
The pair from the example. Reproduced: react-dom 18.3.1 declares react ^18.3.1 and installs cleanly beside react 18.3.1.