mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 02:57:29 +00:00
fix: resolve symlinks in pnpm/bun global install detection (#24744)
Use tryRealpath() instead of path.resolve() when comparing expected package paths in detectGlobalInstallManagerForRoot(). path.resolve() only normalizes path strings without following symlinks, causing pnpm global installs to go undetected since pnpm symlinks node_modules entries into its .pnpm content-addressable store. Fixes #22768 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -84,7 +84,8 @@ export async function detectGlobalInstallManagerForRoot(
|
||||
const globalReal = await tryRealpath(globalRoot);
|
||||
for (const name of ALL_PACKAGE_NAMES) {
|
||||
const expected = path.join(globalReal, name);
|
||||
if (path.resolve(expected) === path.resolve(pkgReal)) {
|
||||
const expectedReal = await tryRealpath(expected);
|
||||
if (path.resolve(expectedReal) === path.resolve(pkgReal)) {
|
||||
return manager;
|
||||
}
|
||||
}
|
||||
@@ -94,7 +95,8 @@ export async function detectGlobalInstallManagerForRoot(
|
||||
const bunGlobalReal = await tryRealpath(bunGlobalRoot);
|
||||
for (const name of ALL_PACKAGE_NAMES) {
|
||||
const bunExpected = path.join(bunGlobalReal, name);
|
||||
if (path.resolve(bunExpected) === path.resolve(pkgReal)) {
|
||||
const bunExpectedReal = await tryRealpath(bunExpected);
|
||||
if (path.resolve(bunExpectedReal) === path.resolve(pkgReal)) {
|
||||
return "bun";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user