Skip to content

ng update error: Error: getaddrinfo ENOTFOUND #9646

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
ayush987goyal opened this issue Feb 16, 2018 · 19 comments
Closed

ng update error: Error: getaddrinfo ENOTFOUND #9646

ayush987goyal opened this issue Feb 16, 2018 · 19 comments

Comments

@ayush987goyal
Copy link

Versions

Angular CLI: 1.7.0
Node: 8.9.3   
OS: win32 x64
Angular: 5.2.1
... animations, common, compiler, compiler-cli, core, forms        
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cdk: 5.1.0                                                           
@angular/cli: 1.7.0
@angular/material: 5.1.0                                                     
@angular-devkit/build-optimizer: 0.3.1                                   
@angular-devkit/core: 0.3.1                                                      
@angular-devkit/schematics: 0.3.1
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.0
@schematics/angular: 0.3.1
@schematics/package-update: 0.3.1
typescript: 2.5.3
webpack: 3.11.0

Repro steps

  • Step 1 run ng update

Observed behavior

following error is thrown

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:80
    at errnoException (dns.js:50:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)

Desired behavior

It should properly update the dependencies

Mention any other details that might be useful (optional)

Running this behind a corporate proxy. Does ng update take that into consideration?

@ssougnez
Copy link

Hello,

I don't think it does. For me, the error is the following:

events.js:182
throw er; // Unhandled 'error' event
^

Error: connect ETIMEDOUT 151.101.36.162:80
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1185:14)

@hansl
Copy link
Contributor

hansl commented Feb 20, 2018

Running this behind a corporate proxy. Does ng update take that into consideration?

No. It needs access to npm. Adding an npm proxy flag would help.

@ssougnez
Copy link

I don't think it's enough as I'm using a proxy for npm (otherwise it wouln't work) and I aslo changed the default registry to the "http" version (as the proxy I'm behind was causing issue with the "https") and I have the issue mentioned above.

@hansl
Copy link
Contributor

hansl commented Feb 20, 2018

The flag should be on the update function itself :) We contact the npm registry directly, not passing through npm API, so there's nowhere you can set that proxy right now.

@billfranklin
Copy link

confirm, also affecting me. PC behind corporate firewall fails, identically configured PC outside firewall works. v1.7.1

@jonathan-irvin
Copy link

👍 Some of us corporate folks maintain our own registry that we use instead of the main npm registry, but even still, it doesn't seem to honor the http-proxy values

@ayush987goyal
Copy link
Author

@hansl when is this getting targeted?

@dominikg
Copy link

dominikg commented Apr 4, 2018

this also happens using the migrate-only flag
ng update @angular/cli --migrate-only --from=1.7.3

@ayush987goyal
Copy link
Author

Issue persists with v6.0.0-rc.3

@john-md86
Copy link

john-md86 commented Apr 20, 2018

I do not use corporate internet, nor firewall. Even so, ng update @angular/cli --migrate-only --from=1.7.4 only returns

image

@ayush987goyal
Copy link
Author

The issue still persists with v^6.0.0

With the latest release of Angular, we are in desperate need of ng update to work in our environments. Can this issue be addressed on priority?

@AlgoTrader
Copy link

I also experience ng update problems behind corp proxy. Please make it high priority

@icorne
Copy link

icorne commented May 4, 2018

Are you still getting this?
I've manually updated my project local angular/cli to 6.0.0 (so no rc)
and it works with the following call: (real values are different ofc)

ng update --registery http://my-registery.local/repository/npm-all --proxy proxy.server:9999

@AlgoTrader
Copy link

AlgoTrader commented May 4, 2018

ng update always write
unable to verify the first certificate

With NODE_TLS_REJECT_UNAUTHORIZED=0 I get
SSL Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE

Unfortunately, that's all I can get

@mevsungur
Copy link

I have getting same problem now.

@mgechev
Copy link
Member

mgechev commented Dec 19, 2018

This should be a solution to the problem #9646 (comment)
Make sure you're using the latest CLI.

@mgechev mgechev closed this as completed Dec 19, 2018
@woppa684
Copy link

woppa684 commented Jan 8, 2019

@mgechev ... but proxy is not a valid argument to ng update, and only registry isn't enought because when I use our internal registry then it starts complaining about the authentication of course :)

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

Also, when I run it with verbose it seems to loop for a while (paths changed):

ng update @angular/cli --verbose
    Locating potential npmrc files:
    Trying 'c:\nodejs\path\.npmrc'...not found.
    Trying 'C:\Users\myusername\.npmrc'...not found.
    Trying 'D:\projectroot\.npmrc'...not found.
    Trying 'D:\projectroot\myproject\.npmrc'...found.
    Locating potential npmrc files:
    Trying 'c:\nodejs\path\.npmrc'...not found.
    Trying 'C:\Users\myusername\.npmrc'...not found.
    Trying 'D:\projectroot\.npmrc'...not found.
    Trying 'D:\projectroot\myproject\.npmrc'...found.
    Locating potential npmrc files:
    Trying 'c:\nodejs\path\.npmrc'...not found.
    Trying 'C:\Users\myusername\.npmrc'...not found.
    Trying 'D:\projectroot\.npmrc'...not found.
    Trying 'D:\projectroot\myproject\.npmrc'...found.
    ... more loops here
request to https://registry.npmjs.org/@angular-devkit%2fbuild-angular failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443

But the "found" .npmrc file contains our private registry and the authentication etc...

@hbthanki
Copy link

If anyone is still facing issue, from moving angular 5.2 to 7, following worked for me:

  • yarn global add @angular/cli
  • yarn add @angular/cli
  • update @angular/cli --packageManager yarn

@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.
Projects
None yet
Development

No branches or pull requests