Fix "Unknown env config" npm warnings during rush-pnpm operations#5716
Draft
Fix "Unknown env config" npm warnings during rush-pnpm operations#5716
Conversation
…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
Copilot created this pull request from a session on behalf of
iclanton
March 23, 2026 18:51
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rush-pnpm publishemits spurious npm warnings becauseRushPnpmCommandLineParser._executeAsync()passes pnpm configuration viaNPM_CONFIG_*environment variables, which leak to npm when pnpm delegates to npm's registry libraries internally.PR #5574 fixed
.npmrccontent filtering forrush install/install-runbut did not cover therush-pnpmcode path.Changes
NPM_CONFIG_WORKSPACE_DIR,NPM_CONFIG_STORE_DIR,NPM_CONFIG_CACHE_DIR,NPM_CONFIG_STATE_DIRenv vars with pnpm CLI args (--config.workspaceDir,--store-dir,--config.cacheDir,--config.stateDir)BaseInstallManagerwhich already uses CLI args (--store,--config.cacheDir,--config.stateDir) for the same purpose duringrush install/rush updateNote: The "Unknown project config" warnings for
email/publish-branchoriginate from the project.npmrcfile itself and are outside the scope of this change. Users seeing those should consider usingrush publish(which supports.npmrc-publish) or removing deprecated properties from their.npmrc.