rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

[rush-lib] Update [dot]npmrc

Open L-Qun opened this issue 6 months ago • 4 comments

Since https://registry.npmjs.org/ is already the default npm registry, there's no need to configure it explicitly. Otherwise, it will override the user's local configuration

L-Qun avatar Aug 05 '25 13:08 L-Qun

The repo maintainer generally wants to control which registry the repo talks to explicitly, so overriding whatever the user has configured is the desired behavior. For example, this repo explicitly uses the public registry because it's an OSS project. If a developer has a private registry configured that does not have the public registry configured as an upstream and runs rush install, their installation is likely to fail.

iclanton avatar Aug 06 '25 16:08 iclanton

@iclanton The public npm registry (https://registry.npmjs.org/) is the default registry for all standard npm and pnpm setups. Unless a developer has explicitly changed it, it will be used automatically. Hardcoding it provides no additional benefit.

L-Qun avatar Aug 06 '25 17:08 L-Qun

The additional benefit is the repo owner ensuring that an individual user's override isn't used.

iclanton avatar Aug 06 '25 17:08 iclanton

@iclanton But doesn't it introduce even bigger problems? Users typically won’t notice this configuration after generation, but they’ll have to spend time later figuring out why things are failing. Usually, every company has its own registry, which means as long as they run this command, they’re guaranteed to run into issues.

L-Qun avatar Aug 07 '25 06:08 L-Qun