在laravel项目中运行composer require stevebauman/location
时,我使用ubuntu20.04,得到以下错误
You are running Composer with SSL/TLS protection disabled.
https://repo.packagist.org could not be fully loaded (curl error 5 while downloading https://repo.packagist.org/packages.json: Could not resolve proxy: my.proxyserver.net), package information was loaded from the local cache and may be out of date
In CurlDownloader.php line 377:
curl error 5 while downloading https://repo.packagist.org/p2/stevebauman/location.json: Could not resolve proxy: my.proxyserver.net
require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>...]
我在我的手机上连接到互联网,然后再运行这个命令,我得到流动的错误。
You are running Composer with SSL/TLS protection disabled.
https://repo.packagist.org could not be fully loaded (curl error 7 while downloading https://repo.packagist.org/packages.json: Failed to connect to my.proxyserver.net port 8080: Connection refused), package information was loaded from the local cache and may be out of date
In CurlDownloader.php line 377:
curl error 7 while downloading https://repo.packagist.org/p2/stevebauman/location~dev.json: Failed to connect to my.proxyserver.net port 8080: Connection refused
require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>...]
我如何纠正这个错误??请救救我!
发布于 2022-11-08 20:49:29
似乎composer想要使用代理服务器来连接网络上不可用的连接。在为composer设置代理服务器时查看this question,查看变量http_proxy
的系统环境变量,并在需要时注意它用于还原的值。
然后清除变量:
$ unset http_proxy
恢复:
$ export http_proxy=<YOUR_ORIGINAL_VALUE>
https://stackoverflow.com/questions/74343622
复制相似问题