Skip to content

fix(@angular/cli): copy packageManager field and yarn config for temp installs#33551

Open
clydin wants to merge 1 commit into
angular:mainfrom
clydin:fix-yarn-berry-update-temp
Open

fix(@angular/cli): copy packageManager field and yarn config for temp installs#33551
clydin wants to merge 1 commit into
angular:mainfrom
clydin:fix-yarn-berry-update-temp

Conversation

@clydin

@clydin clydin commented Jul 10, 2026

Copy link
Copy Markdown
Member

When installing a temporary CLI package during update command execution, the active packageManager field value is copied from the project to the temporary package.json to establish a local version boundary for Corepack and prevent upward directory traversal.

Additionally, configuration copying is enabled for Yarn to copy project-level .yarnrc.yml/.yarnrc.yaml files so custom registries and credentials are preserved.

@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 enhances the package manager utility to support copying and sanitizing Yarn configuration files (.yarnrc.yml and .yarnrc.yaml) during temporary package installations. It strips out fields like yarnPath, plugins, and nodeLinker to prevent issues, and appends nodeLinker: node-modules. Additionally, it copies the project's packageManager field to the temporary package.json to ensure Corepack resolves the correct version. Feedback is provided to improve the robustness of the Yarn configuration sanitizer by ensuring only top-level keys (with zero indentation) are stripped, preventing accidental removal of nested properties.

Comment thread packages/angular/cli/src/package-managers/package-manager.ts
… installs

When installing a temporary CLI package during update command execution, the active packageManager field value is copied from the project to the temporary package.json to establish a local version boundary for Corepack and prevent upward directory traversal.

Additionally, configuration copying is enabled for Yarn to copy project-level .yarnrc.yml/.yarnrc.yaml files so custom registries and credentials are preserved.
@clydin clydin force-pushed the fix-yarn-berry-update-temp branch from ff8fe33 to 16c44a7 Compare July 10, 2026 22:37
@clydin clydin linked an issue Jul 10, 2026 that may be closed by this pull request
1 task
@clydin clydin added target: patch This PR is targeted for the next patch release action: review The PR is still awaiting reviews from at least one requested reviewer labels Jul 11, 2026
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.

ng update halts at "Installing a temporary Angular CLI" when using Yarn

1 participant