noproxy config is not respected when running ng update #16615
Labels
area: angular/cli
freq1: low
Only reported by a handful of users who observe it rarely
severity3: broken
type: bug/fix
Milestone
馃悶 Bug report
Command
Is this a regression?
Yes. This would not have been a problem prior to angular/devkit#692 assuming a private registry was accessible without proxy. It is also relevant to #13166 .
Description
NPM natively supports a
noproxy
setting in the.npmrc
file that will prevent the proxy settings from being used for some specific URLs. This is incredibly useful when you have a private repository that is within your corporate network, but some packages, likenode-sass
will still need to reach to the internet to download binary files through the proxy.Assuming that your private registry is at
registry.company.com
, you can add either the full sub-domain, or even justcompany.com
to thenoproxy
setting and NPM will go to the registry directly, but all calls to other URLs done by NPM will still go through the proxy.When using
ng update
, all calls usingnpm-registry-client
will go through the proxy, even though they should be blacklisted by thenoproxy
list. This will cause calls to fail when using an enterprise proxy and a private registry that cannot be reached through the proxy.馃敩 Minimal Reproduction
.npmrc
file like so:ng update
.馃敟 Exception or Error
At this point,
ng update
will fail trying to parse the json file that is expected from the registry and print the html error page returned by the proxy instead. Something on the lines of:馃實 Your Environment
Anything else relevant?
Requires a private repository and proxy that cannot reach the repository.
Workaround
Since
ng-update
will run NPM install scripts after doing thenpm-registry-client
calls, it is possible to remove the proxy setting before runningng update
, and add it back as npm starts the install process using a second console. This will work as long as the first few packages getting installed does not do any network calls in their install script. It is also an incredibly risky workaround and I would recommend anyone attempting this to delete theirnode_modules
folders after the update process, set their proxy settings correctly and re-runnpm install
before moving on.The text was updated successfully, but these errors were encountered: