Open kenrick95 opened 1 month ago
The easiest way to handle this is to probably create a .npmrc
specifically for autoinstallers. @kenrick95 - Would you be interested in putting together that change?
Sure thing!
To approach this, I'm thinking of having an optional .npmrc-autoinstaller
in common/config/rush/
, which works like .npmrc-publish
.
.npmrc-autoinstaller
to the autoinstaller folder..npmrc-autoinstaller
doesn't exist, then it will use common/config/rush/.npmrc
. This is the existing behavior.How does that sound?
Summary
When updating autoinstaller's lockfile, the PNPM
auto-install-peers
config isn't inherited from pnpm-config.json. It seems like it is using the PNPM's default value, in which in PNPM 8, it defaults toauto-install-peers = true
.One workaround is to edit
common/config/rush/.npmrc
to add the line that saysauto-install-peers = false
. However this will emit warning when runningrush install
/rush update
:If it is not meant to inherit the config from pnpm-config.json, there should be other way to set this config only for the autoinstaller. At point of writing, it is not possible to create a
.npmrc
only for autoinstaller as Rush will sync thecommon/config/rush/.npmrc
to the autoinstaller's.npmrc
Repro steps
Repro repo: https://github.com/kenrick95/rush-repro-autoinstaller-autoinstallpeers
react-router@^5
as dependency.react
is a peer dependency.react
is not installed. (link to lockfile)One autoinstaller that has
react-router@^5
as dependency.react
is a peer dependency.react
is installed. (link to lockfile)Expected result: the
auto-install-peers
config in autoinstaller should inherit from pnpm-config.json? If not, there should be other way to set this config only for the autoinstaller. At point of writing, it is not possible toActual result: the
auto-install-peers
config in autoinstaller uses the pnpm's global default configDetails
Standard questions
Please answer these questions to help us investigate your issue more quickly:
@microsoft/rush
globally installed version?rushVersion
from rush.json?useWorkspaces
from rush.json?node -v
)?