angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng update error: Error: getaddrinfo ENOTFOUND

Open ayush987goyal opened this issue 8 years ago • 19 comments

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?

ayush987goyal avatar Feb 16 '18 05:02 ayush987goyal

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)

ssougnez avatar Feb 20 '18 12:02 ssougnez

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.

hansl avatar Feb 20 '18 17:02 hansl

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.

ssougnez avatar Feb 20 '18 19:02 ssougnez

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.

hansl avatar Feb 20 '18 20:02 hansl

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

billfranklin avatar Feb 26 '18 15:02 billfranklin

👍 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

jonathan-irvin avatar Mar 02 '18 17:03 jonathan-irvin

@hansl when is this getting targeted?

ayush987goyal avatar Mar 13 '18 07:03 ayush987goyal

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

ghost avatar Apr 04 '18 07:04 ghost

Issue persists with v6.0.0-rc.3

ayush987goyal avatar Apr 12 '18 05:04 ayush987goyal

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

image

john-md86 avatar Apr 20 '18 16:04 john-md86

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?

ayush987goyal avatar May 04 '18 06:05 ayush987goyal

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

AlgoTrader avatar May 04 '18 08:05 AlgoTrader

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

icorne avatar May 04 '18 11:05 icorne

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

AlgoTrader avatar May 04 '18 13:05 AlgoTrader

I have getting same problem now.

mevsungur avatar Dec 10 '18 06:12 mevsungur

This should be a solution to the problem https://github.com/angular/angular-cli/issues/9646#issuecomment-386568489 Make sure you're using the latest CLI.

mgechev avatar Dec 19 '18 19:12 mgechev

@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...

woppa684 avatar Jan 08 '19 07:01 woppa684

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

hbthanki avatar Mar 12 '19 18:03 hbthanki

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.