fix(@angular/cli): copy project config files to temp directory during ng update by ptu14 · Pull Request #32959 · angular/angular-cli
Fixes #27163
PR Checklist
Please check to confirm your PR fulfills the following requirements:
- The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-commit-message-guidelines
- Tests for the changes have been added (for bug fixes / features)
- Docs have been added / updated (for bug fixes / features)
PR Type
What kind of change does this PR introduce?
- Bugfix
- Feature
- Code style update (formatting, local variables)
- Refactoring (no functional changes, no api changes)
- Build related changes
- CI related changes
- Documentation content changes
- Other... Please describe:
What is the current behavior?
During ng update, the CLI installs a temporary version of itself in a system temp directory (e.g. /tmp/angular-cli-packages-xxx). Since this directory is outside the project tree, npm/pnpm/yarn-classic cannot find the project's .npmrc and falls back to the user-level ~/.npmrc. This causes registry settings defined in the project's .npmrc to be ignored.
Issue Number: #27163
What is the new behavior?
Project configuration files (.npmrc, .yarnrc, pnpm-workspace.yaml) are now copied to the temporary directory before running npm install. This reuses the existing copyConfigFromProject mechanism (previously only enabled for bun) for npm, pnpm, and yarn-classic.
Does this PR introduce a breaking change?
- Yes
- No