mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-28 02:53:15 -04:00
6
.changeset/two-points-peel.md
Normal file
6
.changeset/two-points-peel.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/resolve-dependencies": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Fix aliased dependencies resolution on repeat install with existing lockfile [#7957](https://github.com/pnpm/pnpm/issues/7957).
|
||||
@@ -1139,7 +1139,11 @@ async function resolveDependency (
|
||||
}
|
||||
try {
|
||||
if (!options.update && currentPkg.version && currentPkg.pkgId?.endsWith(`@${currentPkg.version}`)) {
|
||||
wantedDependency.pref = currentPkg.version
|
||||
if (semver.validRange(wantedDependency.pref)) {
|
||||
wantedDependency.pref = currentPkg.version
|
||||
} else if (wantedDependency.pref.startsWith('npm:')) {
|
||||
wantedDependency.pref = `${wantedDependency.pref.substring(0, wantedDependency.pref.lastIndexOf('@') + 1)}${currentPkg.version}`
|
||||
}
|
||||
}
|
||||
pkgResponse = await ctx.storeController.requestPackage(wantedDependency, {
|
||||
alwaysTryWorkspacePackages: ctx.linkWorkspacePackagesDepth >= options.currentDepth,
|
||||
|
||||
Reference in New Issue
Block a user