fix: install absolute path pkg failed (#9888)

This commit is contained in:
btea
2025-12-22 21:57:45 +08:00
committed by GitHub
parent 1cc61e87bc
commit ac4c9f4b96
2 changed files with 7 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"@pnpm/headless": patch
---
Failed to install dependency packages under absolute paths on different disk paths.

View File

@@ -794,7 +794,8 @@ async function getRootPackagesToLink (
if (ref.startsWith('link:')) {
const isDev = Boolean(projectSnapshot.devDependencies?.[alias])
const isOptional = Boolean(projectSnapshot.optionalDependencies?.[alias])
const packageDir = path.join(opts.projectDir, ref.slice(5))
ref = ref.slice(5)
const packageDir = path.isAbsolute(ref) ? ref : path.join(opts.projectDir, ref)
const linkedPackage = await (async () => {
const importerId = getLockfileImporterId(opts.lockfileDir, packageDir)
if (opts.importerManifestsByImporterId[importerId]) {