Commit 48f90f5
committed
fix(@angular/cli): prevent Yarn registry environment variable override
When running scripts via Yarn Classic (such as yarn ng update), Yarn automatically injects
npm_config_registry=https://registry.yarnpkg.com into the child process environment.
When the PackageManager abstraction spawns child CLI subprocesses (such as yarn info), those child
processes inherit the injected registry environment variable. Because environment variables take
highest precedence, this previously caused spawned subprocesses to ignore local .yarnrc files and
query the public CDN mirror.
Strip npm_config_registry and NPM_CONFIG_REGISTRY from the child process environment when running
under Yarn so that spawned subprocesses correctly respect local repository registry settings.1 parent c7c8047 commit 48f90f5
1 file changed
Lines changed: 22 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
132 | 153 | | |
133 | 154 | | |
134 | 155 | | |
135 | 156 | | |
136 | 157 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 158 | + | |
144 | 159 | | |
145 | 160 | | |
146 | 161 | | |
| |||
0 commit comments