Skip to content

[rush] Rush is filtering out pnpm options from .npmrc when copying into common/temp #5641

Description

@dmichon-msft

Summary

Rush's new logic to comment out configuration properties from .npmrc that are not understood by npm (introduced in #5574 ) is incorrectly also operating when copying the .npmrc file to common/temp for use by pnpm.

Importantly, this is removing options like hoist=false and public-hoist-pattern[]=, which are essential for maintaining dependency strictness.

Repro steps

Include options in common/config/rush/.npmrc

hoist=false
public-hoist-pattern[]=

Expected result:
File at common/temp/.npmrc contains

hoist=false
public-hoist-pattern[]=

Actual result:
File at common/temp/.npmrc contains

; UNSUPPORTED BY NPM: public-hoist-pattern[]=
; UNSUPPORTED BY NPM: hoist=false

Details

This filtering should not occur when copying into common/temp when the package manager is pnpm.

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/rush globally installed version? 5.169.1
rushVersion from rush.json? 5.169.1
pnpmVersion, npmVersion, or yarnVersion from rush.json? 8.14.0
(if pnpm) useWorkspaces from pnpm-config.json? true
Operating system? Linux
Would you consider contributing a PR? Yes
Node.js version (node -v)? 22.16.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions