[rush]Fix "Unknown env config" npm warnings during rush-pnpm operations#5716
Open
[rush]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
iclanton
reviewed
Mar 25, 2026
common/changes/@microsoft/rush/fix-rush-pnpm-npm-config-warnings_2026-03-23-18-16.json
Outdated
Show resolved
Hide resolved
bmiddha
approved these changes
Mar 25, 2026
…ector 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
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
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.
RushVersionSelector.tscallsinstallPackageInDirectoryAsync()withoutfilterNpmIncompatibleProperties, so when npm installs rush-lib, pnpm-specific .npmrc properties cause warningsfilterNpmIncompatibleProperties: truetoRushVersionSelector.ts⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.