首页 > 解决方案 > 无法下载 dompdf/dompdf Laravel Composer

问题描述

我正在通过 XAMPP 从我的本地机器上运行它。我尝试安装了几次,它仍然给我同样的错误。尝试 ping google.com,并没有显示错误(要清楚我自己这不是 DNS 问题)。在 GitHub 问题上没有发现任何与此相关的具体内容。

当我尝试通过 Composer 要求 barryvdh/laravel-dompdf 时,我收到此错误。

Failed to download dompdf/dompdf from dist: The "https://api.github.com/repos/dompdf/dompdf/zipball/5113accd9ae5d466077cce5208dcf3fb871bf8f6" file could not be downloaded: php_network_getaddresses: getaddrinfo failed: No such host is known.
failed to open stream: php_network_getaddresses: getaddrinfo failed: No such host is known.

以下是从 bash 复制的详细信息。

$ composer require barryvdh/laravel-dompdf
Using version ^0.8.2 for barryvdh/laravel-dompdf
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 5 installs, 0 updates, 0 removals
  - Installing sabberworm/php-css-parser (8.1.0): Downloading (100%)
  - Installing phenx/php-svg-lib (v0.3.2): Downloading (100%)
  - Installing phenx/php-font-lib (0.5.1): Downloading (100%)
  - Installing dompdf/dompdf (v0.8.2): Downloading (90%)
Downloading (failed)
Downloading (failed)    Failed to download dompdf/dompdf from dist: The "https://api.github.com/repos/dompdf/dompdf/zipball/5113accd9ae5d466077cce5208dcf3fb871bf8f6" file could not be downloaded: php_network_getaddresses: getaddrinfo failed: No such host is known.
failed to open stream: php_network_getaddresses: getaddrinfo failed: No such host is known.
    Now trying to download from source
  - Installing dompdf/dompdf (v0.8.2): Cloning 5113accd9a


  [RuntimeException]
  Failed to clone https://github.com/dompdf/dompdf.git via https, ssh protocols, aborting.
  - https://github.com/dompdf/dompdf.git
    Cloning into 'D:\xampp\htdocs\rtdo\vendor\dompdf\dompdf'...
    fatal: unable to access 'https://github.com/dompdf/dompdf.git/': Could not resolve host: github.com
  - git@github.com:dompdf/dompdf.git
    Cloning into 'D:\xampp\htdocs\rtdo\vendor\dompdf\dompdf'...
    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.

如果您需要更多详细信息,请告诉我。谢谢你!

标签: phplaravellaravel-5composer-php

解决方案


推荐阅读