You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 to auto-install-peers = true.
One workaround is to edit common/config/rush/.npmrc to add the line that says auto-install-peers = false. However this will emit warning when running rush install/rush update:
Warning: PNPM's auto-install-peers is specified in both .npmrc and pnpm-config.json. The value in pnpm-config.json will take precedence.
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 the common/config/rush/.npmrc to the autoinstaller's .npmrc
One workspace project that has 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 to
Actual result: the auto-install-peers config in autoinstaller uses the pnpm's global default config
Details
Standard questions
Please answer these questions to help us investigate your issue more quickly:
Question
Answer
@microsoft/rush globally installed version?
5.117.8
rushVersion from rush.json?
5.124.7
useWorkspaces from rush.json?
Yes
Operating system?
Mac
Would you consider contributing a PR?
Yes
Node.js version (node -v)?
18.20.2
The text was updated successfully, but these errors were encountered:
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?
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
One workspace project that has
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
)?The text was updated successfully, but these errors were encountered: