I am facing a certificate error while trying to install NPM packages on Windows. I am using Node v10.9.0

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
11
down vote

favorite













npm ERR! code ERR_TLS_CERT_ALTNAME_INVALID

npm ERR! errno ERR_TLS_CERT_ALTNAME_INVALID

npm ERR! request to https://registry.npmjs.org/http-server failed, reason: 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








share|improve this question


















  • 1




    That's really interesting, I confirm the registry.npmjs.org cert is invalid, it's issued to a.sni.fastly.net so there's domain name mismatch (Chrome shows ERR_CERT_COMMON_NAME_INVALID). I don't think it's intented and looks like a serious issue at the npm registry side. Hope they fix it asap.
    – Wiktor Zychla
    Sep 1 at 12:12






  • 1




    Check status.npmjs.org
    – wyrdrender
    Sep 1 at 12:13











  • Thankyou everyone!! The issue seems to be fixed now.
    – tech4GT
    Sep 2 at 13:23














up vote
11
down vote

favorite













npm ERR! code ERR_TLS_CERT_ALTNAME_INVALID

npm ERR! errno ERR_TLS_CERT_ALTNAME_INVALID

npm ERR! request to https://registry.npmjs.org/http-server failed, reason: 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








share|improve this question


















  • 1




    That's really interesting, I confirm the registry.npmjs.org cert is invalid, it's issued to a.sni.fastly.net so there's domain name mismatch (Chrome shows ERR_CERT_COMMON_NAME_INVALID). I don't think it's intented and looks like a serious issue at the npm registry side. Hope they fix it asap.
    – Wiktor Zychla
    Sep 1 at 12:12






  • 1




    Check status.npmjs.org
    – wyrdrender
    Sep 1 at 12:13











  • Thankyou everyone!! The issue seems to be fixed now.
    – tech4GT
    Sep 2 at 13:23












up vote
11
down vote

favorite









up vote
11
down vote

favorite












npm ERR! code ERR_TLS_CERT_ALTNAME_INVALID

npm ERR! errno ERR_TLS_CERT_ALTNAME_INVALID

npm ERR! request to https://registry.npmjs.org/http-server failed, reason: 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








share|improve this question















npm ERR! code ERR_TLS_CERT_ALTNAME_INVALID

npm ERR! errno ERR_TLS_CERT_ALTNAME_INVALID

npm ERR! request to https://registry.npmjs.org/http-server failed, reason: 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










share|improve this question













share|improve this question




share|improve this question








edited Sep 2 at 3:23









Boann

35.6k1184116




35.6k1184116










asked Sep 1 at 11:56









tech4GT

594




594







  • 1




    That's really interesting, I confirm the registry.npmjs.org cert is invalid, it's issued to a.sni.fastly.net so there's domain name mismatch (Chrome shows ERR_CERT_COMMON_NAME_INVALID). I don't think it's intented and looks like a serious issue at the npm registry side. Hope they fix it asap.
    – Wiktor Zychla
    Sep 1 at 12:12






  • 1




    Check status.npmjs.org
    – wyrdrender
    Sep 1 at 12:13











  • Thankyou everyone!! The issue seems to be fixed now.
    – tech4GT
    Sep 2 at 13:23












  • 1




    That's really interesting, I confirm the registry.npmjs.org cert is invalid, it's issued to a.sni.fastly.net so there's domain name mismatch (Chrome shows ERR_CERT_COMMON_NAME_INVALID). I don't think it's intented and looks like a serious issue at the npm registry side. Hope they fix it asap.
    – Wiktor Zychla
    Sep 1 at 12:12






  • 1




    Check status.npmjs.org
    – wyrdrender
    Sep 1 at 12:13











  • Thankyou everyone!! The issue seems to be fixed now.
    – tech4GT
    Sep 2 at 13:23







1




1




That's really interesting, I confirm the registry.npmjs.org cert is invalid, it's issued to a.sni.fastly.net so there's domain name mismatch (Chrome shows ERR_CERT_COMMON_NAME_INVALID). I don't think it's intented and looks like a serious issue at the npm registry side. Hope they fix it asap.
– Wiktor Zychla
Sep 1 at 12:12




That's really interesting, I confirm the registry.npmjs.org cert is invalid, it's issued to a.sni.fastly.net so there's domain name mismatch (Chrome shows ERR_CERT_COMMON_NAME_INVALID). I don't think it's intented and looks like a serious issue at the npm registry side. Hope they fix it asap.
– Wiktor Zychla
Sep 1 at 12:12




1




1




Check status.npmjs.org
– wyrdrender
Sep 1 at 12:13





Check status.npmjs.org
– wyrdrender
Sep 1 at 12:13













Thankyou everyone!! The issue seems to be fixed now.
– tech4GT
Sep 2 at 13:23




Thankyou everyone!! The issue seems to be fixed now.
– tech4GT
Sep 2 at 13:23












2 Answers
2






active

oldest

votes

















up vote
4
down vote













It seems that it's a real problem on the NPM servers. I see the same error when navigating to https://registry.npmjs.org/http-server in a browser. The server indeed doesn't have a valid certificate. Nothing Windows-specific.



NPM reports there's an issue with incorrect DNS information being cached, here: https://status.npmjs.org/incidents/v22ffls5cd6h



Until the cache clears up, they suggest doing the following:



  1. dig registry.npmjs.com @1.1.1.1

  2. Add the IP found to your /etc/hosts file.

Update: A bit unrelated, for ones using yarn: Yarn's mirror of the NPM registry seems to be affected by this problem too, so it seems that at the moment all we can do is wait until the issue resolves itself or the Yarn team applies a workaround on the server.






share|improve this answer





























    up vote
    1
    down vote













    The officially suggested solution with adding IPs found via the dig command into the hosts file somehow didn't work for me.



    I found that there is a strict-ssl configuration option for npm.



    Creating a .npmrc file in my project folder with strict-ssl = false solved the issue.



    I find this solution safer and more isolated since editing the hosts file might not be possible for everyone and when it is, it will cause every request made from your computer to be routed to a specific IP address.



    I plan to remove that file when this temporary issue is fixed.






    share|improve this answer






















      Your Answer





      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: true,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52127857%2fi-am-facing-a-certificate-error-while-trying-to-install-npm-packages-on-windows%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      4
      down vote













      It seems that it's a real problem on the NPM servers. I see the same error when navigating to https://registry.npmjs.org/http-server in a browser. The server indeed doesn't have a valid certificate. Nothing Windows-specific.



      NPM reports there's an issue with incorrect DNS information being cached, here: https://status.npmjs.org/incidents/v22ffls5cd6h



      Until the cache clears up, they suggest doing the following:



      1. dig registry.npmjs.com @1.1.1.1

      2. Add the IP found to your /etc/hosts file.

      Update: A bit unrelated, for ones using yarn: Yarn's mirror of the NPM registry seems to be affected by this problem too, so it seems that at the moment all we can do is wait until the issue resolves itself or the Yarn team applies a workaround on the server.






      share|improve this answer


























        up vote
        4
        down vote













        It seems that it's a real problem on the NPM servers. I see the same error when navigating to https://registry.npmjs.org/http-server in a browser. The server indeed doesn't have a valid certificate. Nothing Windows-specific.



        NPM reports there's an issue with incorrect DNS information being cached, here: https://status.npmjs.org/incidents/v22ffls5cd6h



        Until the cache clears up, they suggest doing the following:



        1. dig registry.npmjs.com @1.1.1.1

        2. Add the IP found to your /etc/hosts file.

        Update: A bit unrelated, for ones using yarn: Yarn's mirror of the NPM registry seems to be affected by this problem too, so it seems that at the moment all we can do is wait until the issue resolves itself or the Yarn team applies a workaround on the server.






        share|improve this answer
























          up vote
          4
          down vote










          up vote
          4
          down vote









          It seems that it's a real problem on the NPM servers. I see the same error when navigating to https://registry.npmjs.org/http-server in a browser. The server indeed doesn't have a valid certificate. Nothing Windows-specific.



          NPM reports there's an issue with incorrect DNS information being cached, here: https://status.npmjs.org/incidents/v22ffls5cd6h



          Until the cache clears up, they suggest doing the following:



          1. dig registry.npmjs.com @1.1.1.1

          2. Add the IP found to your /etc/hosts file.

          Update: A bit unrelated, for ones using yarn: Yarn's mirror of the NPM registry seems to be affected by this problem too, so it seems that at the moment all we can do is wait until the issue resolves itself or the Yarn team applies a workaround on the server.






          share|improve this answer














          It seems that it's a real problem on the NPM servers. I see the same error when navigating to https://registry.npmjs.org/http-server in a browser. The server indeed doesn't have a valid certificate. Nothing Windows-specific.



          NPM reports there's an issue with incorrect DNS information being cached, here: https://status.npmjs.org/incidents/v22ffls5cd6h



          Until the cache clears up, they suggest doing the following:



          1. dig registry.npmjs.com @1.1.1.1

          2. Add the IP found to your /etc/hosts file.

          Update: A bit unrelated, for ones using yarn: Yarn's mirror of the NPM registry seems to be affected by this problem too, so it seems that at the moment all we can do is wait until the issue resolves itself or the Yarn team applies a workaround on the server.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Sep 2 at 3:24









          Boann

          35.6k1184116




          35.6k1184116










          answered Sep 1 at 12:19









          Egor Kalinichev

          414




          414






















              up vote
              1
              down vote













              The officially suggested solution with adding IPs found via the dig command into the hosts file somehow didn't work for me.



              I found that there is a strict-ssl configuration option for npm.



              Creating a .npmrc file in my project folder with strict-ssl = false solved the issue.



              I find this solution safer and more isolated since editing the hosts file might not be possible for everyone and when it is, it will cause every request made from your computer to be routed to a specific IP address.



              I plan to remove that file when this temporary issue is fixed.






              share|improve this answer


























                up vote
                1
                down vote













                The officially suggested solution with adding IPs found via the dig command into the hosts file somehow didn't work for me.



                I found that there is a strict-ssl configuration option for npm.



                Creating a .npmrc file in my project folder with strict-ssl = false solved the issue.



                I find this solution safer and more isolated since editing the hosts file might not be possible for everyone and when it is, it will cause every request made from your computer to be routed to a specific IP address.



                I plan to remove that file when this temporary issue is fixed.






                share|improve this answer
























                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  The officially suggested solution with adding IPs found via the dig command into the hosts file somehow didn't work for me.



                  I found that there is a strict-ssl configuration option for npm.



                  Creating a .npmrc file in my project folder with strict-ssl = false solved the issue.



                  I find this solution safer and more isolated since editing the hosts file might not be possible for everyone and when it is, it will cause every request made from your computer to be routed to a specific IP address.



                  I plan to remove that file when this temporary issue is fixed.






                  share|improve this answer














                  The officially suggested solution with adding IPs found via the dig command into the hosts file somehow didn't work for me.



                  I found that there is a strict-ssl configuration option for npm.



                  Creating a .npmrc file in my project folder with strict-ssl = false solved the issue.



                  I find this solution safer and more isolated since editing the hosts file might not be possible for everyone and when it is, it will cause every request made from your computer to be routed to a specific IP address.



                  I plan to remove that file when this temporary issue is fixed.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Sep 2 at 3:28









                  Boann

                  35.6k1184116




                  35.6k1184116










                  answered Sep 1 at 12:46









                  koraytaylan

                  4192613




                  4192613



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52127857%2fi-am-facing-a-certificate-error-while-trying-to-install-npm-packages-on-windows%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Comments

                      Popular posts from this blog

                      What does second last employer means? [closed]

                      List of Gilmore Girls characters

                      Confectionery