rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

[RRFC] The `.npmrc` file should be valid for any dependency, whether direct or indirect

Open fltenwall opened this issue 3 years ago • 1 comments

Motivation

The background of this problem is that I have A project whose direct dependency on A is A ', and another direct dependency on B that depends on C is C '. After I set the corresponding cache to A and C in the.npmrc file, the indirect dependency on C will not take effect and its address will be the global address

Example

registry=https://registry.npm.taobao.org/
A:registry=A'
C:registry=C'

The directly dependent address of A is the correct A ', but the address of indirect C is the global registry

How

Current Behaviour

The setting of indirect dependencies is invalid in the '.npmrc' file

Desired Behaviour

Both direct and indirect dependencies should be downloaded correctly according to the configuration

References

  • Related/Reference to #4762

fltenwall avatar Apr 18 '22 03:04 fltenwall

It sounds like you might be trying to reference multiple packages of the same name across different registries(?) If that is indeed the case, you should likely be defining the registries as scopes & then would be able to reference the package in your code/package.json accordingly (ref. https://docs.npmjs.com/cli/v8/using-npm/scope). Let me know if you're talking about something else though.

darcyclarke avatar Apr 27 '22 16:04 darcyclarke