Skip to content

fix(@angular/cli): mitigate package self-referencing in local CLI resolution - #33740

Open
alan-agius4 wants to merge 1 commit into
angular:mainfrom
alan-agius4:fix-cli-self-reference-resolution
Open

fix(@angular/cli): mitigate package self-referencing in local CLI resolution#33740
alan-agius4 wants to merge 1 commit into
angular:mainfrom
alan-agius4:fix-cli-self-reference-resolution

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

Instead of resolving @angular/cli when bootstrapping the local CLI, we resolve @angular/cli/lib/cli/index.js. This ensures that Node.js only resolves the local CLI if the specific directory structure exists inside node_modules, preventing unintended package self-reference resolutions outside of node_modules.

…olution

Instead of resolving `@angular/cli` when bootstrapping the local CLI, we resolve `@angular/cli/lib/cli/index.js`. This ensures that Node.js only resolves the local CLI if the specific directory structure exists inside `node_modules`, preventing unintended package self-reference resolutions outside of `node_modules`.
@alan-agius4
alan-agius4 requested a review from dgp1130 August 4, 2026 08:00
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Aug 4, 2026
gemini-code-assist[bot]

This comment was marked as low quality.

gemini-code-assist[bot]

This comment was marked as low quality.

@alan-agius4

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the CLI initialization in packages/angular/cli/lib/init.ts to resolve @angular/cli/lib/cli/index.js instead of @angular/cli. This ensures that Node.js only resolves the path if the specific folder structure exists in node_modules, preventing self-referencing package resolution issues. There are no review comments, so I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular/cli target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant