作曲家要求 - 找不到匹配版本的包

发布于 2025-01-14 14:34:10 字数 3240 浏览 2 评论 0原文

每当我运行composer require [package name]时,我都会得到这样的信息:

composer require usmanhalalit/laracsv

                                                                                                                                                                                            
  [InvalidArgumentException]                                                                                                                                                                
  Could not find a matching version of package usmanhalalit/laracsv. Check the package spelling, your version constraint and that the package is available in a stability which matches yo  
  ur minimum-stability (dev).                                                                                                                                                               
                                                                                                                                                                                            

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>]... 

我在任何包中都会收到此消息,因此这不仅仅是usmanhalalit/laracsv的问题。如果我直接在composer.json中声明包+版本,然后运行composer update,我也会收到消息。

作曲家诊断: (我已确保获得最新的稳定版本的composer。)

$ composer diagnose
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys: 
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 2.2.9
PHP version: 7.2.0 - Package overridden via config.platform, actual: 7.3.8
PHP binary path: /Applications/MAMP/bin/php/php7.3.8/bin/php
OpenSSL version: OpenSSL 1.0.2o  27 Mar 2018
cURL version: 7.65.1 libz 1.2.8 ssl OpenSSL/1.0.2o
zip: extension present, unzip present, 7-Zip not available


这是我的composer.json

{
    "name": "laravel/lumen",
    "description": "The Laravel Lumen Framework",
    "type": "project",
    "license": "MIT",
    "autoload": {
        "psr-4": {
            "Laravel\\Lumen\\": "app/"
        }
    },
    "minimum-stability": "dev",
    "require": {
        
    }
}

有谁知道为什么会发生这种情况?

编辑:

根据要求,这是我的全局 config.json。

{
    "config": {
        "platform": {
            "php": "7.2.0"
        },
        "disable-tls": false},
    "repositories": {
        "packagist": false
    }
}

Whenever I run composer require [package name] I get this:

composer require usmanhalalit/laracsv

                                                                                                                                                                                            
  [InvalidArgumentException]                                                                                                                                                                
  Could not find a matching version of package usmanhalalit/laracsv. Check the package spelling, your version constraint and that the package is available in a stability which matches yo  
  ur minimum-stability (dev).                                                                                                                                                               
                                                                                                                                                                                            

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>]... 

I get this message with any package so it's not just an issue with usmanhalalit/laracsv. I also get the message if I declare the package + version directly in composer.json and then run composer update.

Composer diagnose:
(I've made sure to get the latest stable version of composer.)

$ composer diagnose
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys: 
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 2.2.9
PHP version: 7.2.0 - Package overridden via config.platform, actual: 7.3.8
PHP binary path: /Applications/MAMP/bin/php/php7.3.8/bin/php
OpenSSL version: OpenSSL 1.0.2o  27 Mar 2018
cURL version: 7.65.1 libz 1.2.8 ssl OpenSSL/1.0.2o
zip: extension present, unzip present, 7-Zip not available


This is my composer.json

{
    "name": "laravel/lumen",
    "description": "The Laravel Lumen Framework",
    "type": "project",
    "license": "MIT",
    "autoload": {
        "psr-4": {
            "Laravel\\Lumen\\": "app/"
        }
    },
    "minimum-stability": "dev",
    "require": {
        
    }
}

Does anyone know why this would be happening?

EDIT:

As requested, here is my global config.json.

{
    "config": {
        "platform": {
            "php": "7.2.0"
        },
        "disable-tls": false},
    "repositories": {
        "packagist": false
    }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文