Skip to content

ng update ignores proxy config #13166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
daniel-seitz opened this issue Dec 11, 2018 · 19 comments
Closed

ng update ignores proxy config #13166

daniel-seitz opened this issue Dec 11, 2018 · 19 comments
Milestone

Comments

@daniel-seitz
Copy link

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [x] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

issue was partially discussed here (#10624) after .npmrc issues and later (original issue solved) determined that there is a different issue.

  1. we use yarn with a private repo behind a corporate proxy.
  2. local .npmrc:
    registry=[some url, masked out] always-auth=true
  3. yarn lock contains packages where I see some as resolved with [some url, masked out]
    also there are packages with https://registry.yarnpkg.com/some-package-and-so-on
  4. global .yarnrc (in C:\Users\MyUserName):
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
lastUpdateCheck 1543945019859
  1. global .npmrc (in C:\Users\MyUserName):
//some_path_with_some_token
proxy= http://our_proxy_with_port/
https-proxy= http://our_proxy_with_port
  1. trying to follow commands from update.angular.io
  2. yarn install works, everything else from 6. works but not ng update @angular/cli, message comes up after a while (1 minute or so):
    request to https://registry.npmjs.org/@types%2fjasmine failed, reason: connect ETIMEDOUT
    seems to be on a random package, at another try I got:
    request to https://registry.npmjs.org/codelyzer failed, reason: connect ETIMEDOUT [some ip address and port]

Assumption:

It seems that ng update @angular/cli ignores the proxy since it should go to the configured proxy or https-proxy instead of npmjs.org.

Should the command be ng update @angular/cli@next? (Results in same error message)
P.S. I tried migrate only - which works - and then update the packages via yarn, also works.
I just think that I might miss something that ng update does as well, other than migrating to the angular.json file and lifting the packages to the recent version.

  1. currently still running angular 5.1.1
  2. tried as described with @next option in yarn global add @angular/cli@next and yarn add @angular/cli@next
  3. ng --version:
     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 7.2.0-beta.1
Node: 8.12.0
OS: win32 x64
Angular: 5.1.1
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.12.0-beta.1
@angular-devkit/core         7.2.0-beta.1
@angular-devkit/schematics   7.2.0-beta.1
@angular/cli                 7.2.0-beta.1
@angular/language-service    4.4.6
@schematics/angular          7.2.0-beta.1
@schematics/update           0.12.0-beta.1
rxjs                         5.5.3
typescript                   2.4.2
@ngbot ngbot bot added this to the needsTriage milestone Dec 11, 2018
@catull
Copy link
Contributor

catull commented Dec 11, 2018

@alan-agius4
The same .npmrc is used to initially retrieve all dependencies listed in package.json w/ npm install.

Thus, the configuration is not the problem, such as firewall rule that causes a time-out.

@clydin
Copy link
Member

clydin commented Dec 11, 2018

@daniel-seitz If you are running the latest beta can you try running update with the --verbose option and report the output?

I'll also push a PR (and hopefully get it into beta.2) that will expand the verbose output to also include the final set of options to further aid in troubleshooting.

@daniel-seitz
Copy link
Author

daniel-seitz commented Dec 13, 2018

@clydin thank for for pushing, I tested verbose with beta.2
For each dependency in package.json this is written:


Locating potential npmrc files:
Trying 'C:\Program Files\nodejs\etc\npmrc'...not found.
Trying 'C:\Users\my_user_name\.npmrc'...found.
Trying 'C:\Users\.npmrc'...not found.
Trying 'C:\Users\my_user_name\.npmrc'...found.
Trying 'C:\Users\my_user_name\source\.npmrc'...not found.
Trying 'C:\Users\my_user_name\source\repos\.npmrc'...not found.
Trying 'C:\Users\my_user_name\source\repos\NameOfRepoLocation\.npmrc'...not found.
Trying 'C:\Users\my_user_name\source\repos\NameOfRepoLocation\OurRepo\.npmrc'...found.

Locating potential yarnrc files:
Trying 'C:\Program Files\nodejs\etc\yarnrc'...not found.
Trying 'C:\Users\my_user_name\.yarnrc'...found.
Trying 'C:\Users\.yarnrc'...not found.
Trying 'C:\Users\my_user_name\.yarnrc'...found.
Trying 'C:\Users\my_user_name\source\.yarnrc'...not found.
Trying 'C:\Users\my_user_name\source\repos\.yarnrc'...not found.
Trying 'C:\Users\my_user_name\source\repos\NameOfRepoLocation\.yarnrc'...not found.
Trying 'C:\Users\my_user_name\source\repos\NameOfRepoLocation\OurRepo\.yarnrc'...not found.

So in total more than 50 times this whole block here. Could be enhanced but this is another story.
Then it takes a while until:

request to https://registry.npmjs.org/jasmine-core failed, reason: connect ETIMEDOUT 

Interestingly in my yarn.lock there are 2 entries for jasmine-core:

[email protected]
   version: 2.5.2
   resolved: "our-proxy/jasmine-core/..."
jasmine-core@~2.8.0
   version: 2.8.0
   resolved: "https://registry.yarnpkg.com/jasmine-core/..."

Not sure if that is normal.
Deleted yarn.lock.
Did yarn install again,
then yarn add @angular/cli@next
and ng update @angular/cli --verbose
--> same timeout result

request to https://registry.npmjs.org/@angular%2fcompiler-cli failed, reason: connect ETIMEDOUT 

would be interesting why npmjs.org is asked and what the final configuration looks like.
PS Also just tried the --registry option - which says 'unable to authenticate' this should be done by npmrc.

@YonatanKra
Copy link

That's still not working on my end, using angular cli 7.1.3.
Had to remove all private repo deps, run the update, and put the private ones back as a workaround.

@ahasall
Copy link
Contributor

ahasall commented Dec 19, 2018

Try ng update --registry=<your_internal_registry>.

@dmnk
Copy link

dmnk commented Jan 3, 2019

dupe of #10952 ?

@woppa684
Copy link

woppa684 commented Jan 8, 2019

Try ng update --registry=<your_internal_registry>.

That won't work in our environment however ...

Unable to authenticate, need: Bearer, Basic realm="<our base URI>", Negotiate, NTLM

@Soeren86n
Copy link

Try ng update --registry=<your_internal_registry>.

same like before. request to http://registry.npmjs.org/@angular%2flanguage-service failed, reason: connect ETIMEDOUT 104.16.19.35:80

@santoshyadavdev
Copy link
Contributor

santoshyadavdev commented Jan 10, 2019

Same error here, it is somhow trying to connect to https://registry.npmjs.org don't know why, i already have registry set to my artifactory.
request to https://registry.npmjs.org/@angular%2fplatform-browser failed, reason: connect ETIMEDOUT 104.16.16.35:443

@ndraiman
Copy link

ndraiman commented Jan 13, 2019

Try ng update --registry=<your_internal_registry>.

@ahasall Worked for me, also behind corporate proxy with our own registry

@mgechev mgechev closed this as completed Jan 13, 2019
@mgechev
Copy link
Member

mgechev commented Jan 13, 2019

@nexxado, thanks for sharing :)

@dmnk
Copy link

dmnk commented Jan 14, 2019

@mgechev, i think you've been a bit quick on the draw. Most of us don't have the chance to use internal registries, and OF COURSE it works, if you're accessing an internal service, no matter if the proxy configuration is respected by ng updated. (which seems to be NOT the case).

@mgechev mgechev reopened this Jan 14, 2019
@mgechev
Copy link
Member

mgechev commented Jan 14, 2019

@dmnk yep, you're right. Just reopened.

@woppa684
Copy link

Also relates to my comment here #9646 (comment)

@CSchulz
Copy link

CSchulz commented Jan 17, 2019

Can you retry it with 7.2.2? It fixed our issue with the project npmrc file.

@clydin
Copy link
Member

clydin commented Mar 1, 2019

This should now be corrected with the latest version of the CLI. If anyone is still encountering problems, please open a new issue detailing the problem.

@clydin clydin closed this as completed Mar 1, 2019
@daniel-seitz
Copy link
Author

Sorry for the time off and missing feedback from my side. I'm assigned to another project and can't really test it anymore.
@clydin I saw the new documentation and corresponding changes, thank you for this! And @everybody-here thank you for your effort.

@daniel-seitz
Copy link
Author

Back in the original project - just tried with @angular/[email protected]
It works. Thank you again, done.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests