mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-13 02:41:50 +08:00
fix: resolve CodexLens installation failure with NPM global install
Implements two-pass search strategy to support CodexLens in NPM global installations. Fixes issue #104.
This commit is contained in:
@@ -83,8 +83,8 @@ function findLocalPackagePath(packageName: string): string | null {
|
|||||||
possiblePaths.push(join(cwdParent, packageName));
|
possiblePaths.push(join(cwdParent, packageName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// First pass: prefer non-node_modules paths (development environment)
|
||||||
for (const localPath of possiblePaths) {
|
for (const localPath of possiblePaths) {
|
||||||
// Skip paths inside node_modules
|
|
||||||
if (isInsideNodeModules(localPath)) {
|
if (isInsideNodeModules(localPath)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -94,8 +94,12 @@ function findLocalPackagePath(packageName: string): string | null {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isDevEnvironment()) {
|
// Second pass: allow node_modules paths (NPM global install)
|
||||||
console.log(`[CodexLens] Running from node_modules - will try PyPI for ${packageName}`);
|
for (const localPath of possiblePaths) {
|
||||||
|
if (existsSync(join(localPath, 'pyproject.toml'))) {
|
||||||
|
console.log(`[CodexLens] Found ${packageName} in node_modules at: ${localPath}`);
|
||||||
|
return localPath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user