An internal registry can be reachable directly while public package traffic still needs the office proxy. Keep the proxy settings and add the internal destinations to noproxy.

For example, the relevant .npmrc entries can be:

registry=https://registry.corp.example/repository/npm/
proxy=http://proxy.example:8080
https-proxy=http://proxy.example:8080
noproxy[]=registry.corp.example
noproxy[]=packages.corp.example

The bypass entries name destinations, not the proxy server. They are host entries, so leave the registry's scheme, path and port out of those strings.

In npm 11.6.4's bundled selector, domain components are compared from the right. registry.corp.example matches that hostname and its subdomains. A leading dot is removed during this comparison; a literal asterisk is not needed for the hostname example.

Include a package-content host when the registry returns tarball URLs on another internal hostname. The registry index and the file download can otherwise take different routes.

The array syntax keeps several exceptions readable. npm also documents a comma-separated string form and an environment-derived NO_PROXY default. Inspect the effective noproxy setting used by this invocation when a destination still takes an unexpected route.

ХӀокхунах тера йаззамаш