Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm ERR! code ERR_TLS_CERT_ALTNAME_INVALID

Tags:

npm

angular

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?

like image 951
Muirik Avatar asked Sep 01 '18 14:09

Muirik


Video Answer


1 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

like image 117
Ayoub k Avatar answered Sep 19 '22 06:09

Ayoub k