Commit 6277eca
[rush]Fix "Unknown env config" npm warnings during rush-pnpm operations (#5716)
* fix: convert NPM_CONFIG env vars to CLI args in rush-pnpm to prevent npm warnings
In RushPnpmCommandLineParser._executeAsync(), replace NPM_CONFIG_*
environment variables (STORE_DIR, CACHE_DIR, STATE_DIR, WORKSPACE_DIR)
with pnpm CLI arguments (--store-dir, --config.cacheDir, --config.stateDir,
--config.workspaceDir). This prevents these pnpm-specific configuration
values from leaking to npm when pnpm internally delegates to npm libraries
(e.g. during publish operations), which caused "Unknown env config" warnings.
This approach is consistent with how BaseInstallManager already passes
these values via CLI args during rush install/update.
Fixes #5704
Co-authored-by: iclanton <5010588+iclanton@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/rushstack/sessions/c306dd18-490c-4a52-a3ca-3447740f7280
* Update changefile.
* revert previous RushPnpmCommandLineParser changes; fix RushVersionSelector instead
Co-authored-by: iclanton <5010588+iclanton@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/rushstack/sessions/e3e81359-dd04-4186-979b-7a62e0a663e3
* fix: filter npm-incompatible .npmrc properties in RushVersionSelector
When the Rush version selector uses npm to install a different version of
rush-lib, the .npmrc from the repo is synced but pnpm-specific properties
(like hoist, publish-branch, email, etc.) were not being filtered out.
This caused npm to emit "Unknown env config" and "Unknown project config"
warnings.
Add filterNpmIncompatibleProperties: true to the installPackageInDirectoryAsync
call in RushVersionSelector, matching the pattern already used in
InstallHelpers.ensureLocalPackageManagerAsync().
Fixes #5704
Co-authored-by: iclanton <5010588+iclanton@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/rushstack/sessions/e3e81359-dd04-4186-979b-7a62e0a663e3
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: iclanton <5010588+iclanton@users.noreply.github.com>
Co-authored-by: Ian Clanton-Thuon <iclanton@users.noreply.github.com>1 parent 0c89067 commit 6277eca
2 files changed
Lines changed: 14 additions & 1 deletion
File tree
- apps/rush/src
- common/changes/@microsoft/rush
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments