Magento 2 installation problem – Couldn’t resolve host ‘github.com’

couldnt resolve git hub m2
We were installing Magento 2 on the local environment using composer create-project as shown below -:

composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition .

After few errors related to adding extensions like php_soap.dll, php_xsl.dll and php_intl.dll in php.ini file. We ended up getting the following error with composer update where it was showing Couldn’t resolve host ‘github.com’

[RuntimeException]
  Failed to clone https://github.com/container-interop/container-interop.git 
  via https, ssh protocols, aborting.

  - https://github.com/container-interop/container-interop.git
    Cloning into '..\xampp\htdocs\magento2\vendor\container-interop\container-interop'...
    fatal: unable to access 'https://github.com/container-interop/container-interop.git/': 
    Couldn't resolve host 'github.com'
  - git@github.com:container-interop/container-interop.git
    Cloning into '..\xampp\htdocs\magento2\vendor\container-interop\container-interop'...
    ssh: Could not resolve hostname github.com: Name or service not known
    fatal: Could not read from remote repository.
    Please make sure you have the correct access rights
    and the repository exists.

We managed to resolve the issue by running the following two commands -:

git config --global --unset http.proxy 
git config --global --unset https.proxy

Hope this article helped you in some way. Please leave us your comment and let us know what do you think? Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *