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 |
Summary
Rush's new logic to comment out configuration properties from
.npmrcthat are not understood by npm (introduced in #5574 ) is incorrectly also operating when copying the.npmrcfile tocommon/tempfor use bypnpm.Importantly, this is removing options like
hoist=falseandpublic-hoist-pattern[]=, which are essential for maintaining dependency strictness.Repro steps
Include options in
common/config/rush/.npmrcExpected result:
File at
common/temp/.npmrccontainsActual result:
File at
common/temp/.npmrccontainsDetails
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:
@microsoft/rushglobally installed version?rushVersionfrom rush.json?pnpmVersion,npmVersion, oryarnVersionfrom rush.json?useWorkspacesfrom pnpm-config.json?node -v)?