File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,8 +83,8 @@ function findLocalPackagePath(packageName: string): string | null {
8383 possiblePaths . push ( join ( cwdParent , packageName ) ) ;
8484 }
8585
86+ // First pass: prefer non-node_modules paths (development environment)
8687 for ( const localPath of possiblePaths ) {
87- // Skip paths inside node_modules
8888 if ( isInsideNodeModules ( localPath ) ) {
8989 continue ;
9090 }
@@ -94,8 +94,12 @@ function findLocalPackagePath(packageName: string): string | null {
9494 }
9595 }
9696
97- if ( ! isDevEnvironment ( ) ) {
98- console . log ( `[CodexLens] Running from node_modules - will try PyPI for ${ packageName } ` ) ;
97+ // Second pass: allow node_modules paths (NPM global install)
98+ for ( const localPath of possiblePaths ) {
99+ if ( existsSync ( join ( localPath , 'pyproject.toml' ) ) ) {
100+ console . log ( `[CodexLens] Found ${ packageName } in node_modules at: ${ localPath } ` ) ;
101+ return localPath ;
102+ }
99103 }
100104
101105 return null ;
You can’t perform that action at this time.
0 commit comments