Skip to content

fix(@angular/cli): handle missing package manager during analytics initialization#32929

Merged
clydin merged 1 commit into
angular:mainfrom
clydin:analytics/safe-pm-version
Apr 7, 2026
Merged

fix(@angular/cli): handle missing package manager during analytics initialization#32929
clydin merged 1 commit into
angular:mainfrom
clydin:analytics/safe-pm-version

Conversation

@clydin

@clydin clydin commented Apr 2, 2026

Copy link
Copy Markdown
Member

Wrap getVersion() call in try-catch to prevent a crash during analytics setup when the package manager is not available.

@clydin clydin added target: patch This PR is targeted for the next patch release and removed area: @angular/cli labels Apr 2, 2026

@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 introduces error handling when retrieving the package manager version for analytics by wrapping the call in a try-catch block. A review comment points out that the version is now fetched even when analytics are disabled, which introduces unnecessary performance overhead by spawning a sub-process needlessly; it is recommended to move this logic inside the conditional check for the user ID.

Comment thread packages/angular/cli/src/command-builder/command-module.ts Outdated
…itialization

Wrap getVersion() call in try-catch to prevent a crash during analytics setup when the package manager is not available.
@clydin
clydin force-pushed the analytics/safe-pm-version branch from 97ffd2d to 8d8a710 Compare April 2, 2026 14:46
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Apr 2, 2026
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 7, 2026
@clydin
clydin merged commit 422c818 into angular:main Apr 7, 2026
38 checks passed
@clydin

clydin commented Apr 7, 2026

Copy link
Copy Markdown
Member Author

This PR was merged into the repository. The changes were merged into the following branches:

@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators May 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker 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.

2 participants