composer无法安装laravel依赖项



我正试图使用本指南安装Laravel Excel

我已经在我的composer.json中包含了这一行;

"require": {
    "laravel/framework": "4.2.*",
    "maatwebsite/excel": "1.*"
},

然后我尝试使用命令composer update更新composer。这将导致以下消息。。。。

Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/usr/local/bin/composer self-update" to get the latest version.
Loading composer repositories with package information
The "https://packagist.org/packages.json" file could not be downloaded: php_network_getaddresses: getaddrinfo failed: Name or service not known
failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known
https://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date
Updating dependencies (including require-dev)
[ComposerDownloaderTransportException]
The "http://packagist.org/p/jeremeamia/functionparser$cac3105ac0ad3f9a0f9c9ccabcde36787c8d8f404a003fa47900f84cee475a34.json" file could not be downloaded: php_
network_getaddresses: getaddrinfo failed: Name or service not known
  failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]

当我尝试自我更新composer时(如警告消息中所建议的),我会得到以下信息;

[ComposerDownloaderTransportException]
  The "https://getcomposer.org/version" file could not be downloaded: php_network_getaddresses: getaddrinfo failed: Name or service not known
  failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known

所以我的第一个问题是我无法更新composer。

我的第二个问题是,我不认为Laravel Excel已经安装,因为我在任何地方的vendor/lavel目录中都看不到它(这不是所有依赖项通常存储的地方吗?)

在使用composer和安装依赖项方面,我是一个完全的初学者,直到现在我还没有真正使用过JSON文件,所以在这里真的很吃力。。。

我也遇到过同样的问题。后来,我知道我的代理不允许我更新作曲家。因此,请检查您的代理设置。

适用于Linux用户(Centos 6,7)使用以下命令检查/etc/resolv.conf中的名称服务器是否正常工作

nslookup www.google.com

如果它不起作用,请使用8.8.8.8和8.8.4.4 中的谷歌公共名称服务器

nameserver 8.8.8.8
nameserver 8.8.4.4

相关内容

  • 没有找到相关文章

最新更新