-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
I have a setup where there may be different registries for example
https://myRegistry.com/a/b/package/-/package-1.1.1.tgz
and
https://myRegistry2.com/a/b/package/-/package-1.1.1.tgz
the first registry would return for the tarball
https://myRegistry.com/a/b/package/-/package-1.1.1.tgz
and if we have replace-registry-host
enabled it would replace it like this:
https://myRegistry2.com/a/b/a/b/package/-/package-1.1.1.tgz
This seems like a strange example, but the use case is myRegistry may be a public facing uri but we would want a way to hit the registries through another uri depending on how the environment is configured (for example if we can not hit the public uri from a protected environment)
Expected Behavior
I would expect replace-registry-host
to be able to specify the path that should be replaced instead of just a registry, for example
--replaceRegistryHost=https://myRegistry2.com/a/b/
Steps To Reproduce
The registry can return a tarball that contains a different hostname than the registry
2.
registry=https://myRegistry1.com/a/b
replace-registry-host=always
- npm install
- Unable to hit the registry (certificate issues)
Environment
- npm: 8.19.3
- Node.js: 16.18.0
- OS Name: MacOS
- System Model Name: Macbook Pro
- npm config:
; copy and paste output from `npm config ls` here