npm ERR! code ERR_TLS_CERT_ALTNAME_INVALID

Viewed 26971

It had been a while since I tried setting up a new Angular app -- because I've been working on an existing one for several months.

Today, upon trying to install a new Angular app via the terminal in my Mac, it ran really slowly, and then resulted in this err:

npm ERR! code ERR_TLS_CERT_ALTNAME_INVALID

npm ERR! Hostname/IP does not match certificate's altnames: Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net

How do I address this issue?

4 Answers

run npm config set strict-ssl false and re-run ng new appName

if it doesn't work try to run npm config set registry "http://registry.npmjs.org"

Edit

An earlier outage involving a DNS misconfiguration has lead to some ISPs caching npmjs.com as missing, a workaround for this is to use a third party DNS provider such as Cloudflare or Google, the affected caches should clear within the next 24 hours.

https://status.npmjs.org/incidents/v22ffls5cd6h

I think its npmjs DNS Problem now

Try adding

104.16.16.35 registry.npmjs.org

to your etc\host file with admin right using notepad

Remove it when it is resolved

npm config set strict-ssl false Work for me fine

yes it is working.

MAC => vim /etc/hosts

Thanks

Related