mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-28 02:53:15 -04:00
6
.changeset/spotty-singers-behave.md
Normal file
6
.changeset/spotty-singers-behave.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/resolve-dependencies": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
If making an intersection of peer dependency ranges does not succeed, install should not crash [#4134](https://github.com/pnpm/pnpm/issues/4134).
|
||||
@@ -10,7 +10,7 @@ export function mergePeers (missingPeers: MissingPeerIssuesByPeerName) {
|
||||
intersections[peerName] = ranges[0].wantedRange
|
||||
continue
|
||||
}
|
||||
const intersection = intersect(...ranges.map(({ wantedRange }) => wantedRange))
|
||||
const intersection = safeIntersect(ranges.map(({ wantedRange }) => wantedRange))
|
||||
if (intersection === null) {
|
||||
conflicts.push(peerName)
|
||||
} else {
|
||||
@@ -19,3 +19,11 @@ export function mergePeers (missingPeers: MissingPeerIssuesByPeerName) {
|
||||
}
|
||||
return { conflicts, intersections }
|
||||
}
|
||||
|
||||
function safeIntersect (ranges: string[]): null | string {
|
||||
try {
|
||||
return intersect(...ranges)
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user