软件包开发&quot“:找不到与您的最低稳定性相匹配的软件包MyComp/Livesearch的版本(稳定)

发布于 2025-02-13 21:09:25 字数 1022 浏览 0 评论 0原文

我正在制作一个Laravel Composer软件包

composer.json看起来像是这样,

{
    "name": "mycomp/livesearch",
    "description": "Livewire livesearch package",
    "type": "library",
    "require": {
        "livewire/livewire": "dev-master"
    },
    "license": "MIT",
    "autoload": {
        "psr-4": {
            "mycomp\\Livesearch\\": "src/"
        }
    },
    "authors": [
        {
            "name": "parallax",
            "email": "[email protected]"
        }
    ],
    "minimum-stability": "dev",
    "prefer-stable": true
}

我通过将其添加到我的root composer.json时在本地添加了它,

"repositories": [
    {
      "type": "path",
      "url": "packages/mycomp/*"
    }
  ]

但是当我尝试使用Composer安装软件包需要MyComp/Livesearch我得到的:

找不到匹配您最小稳定性(稳定)的软件包mycomp/livesearch的版本。需要具有明确版本的约束,允许其所需的稳定性。

I'm making a laravel composer package

The composer.json of the package looks like this

{
    "name": "mycomp/livesearch",
    "description": "Livewire livesearch package",
    "type": "library",
    "require": {
        "livewire/livewire": "dev-master"
    },
    "license": "MIT",
    "autoload": {
        "psr-4": {
            "mycomp\\Livesearch\\": "src/"
        }
    },
    "authors": [
        {
            "name": "parallax",
            "email": "[email protected]"
        }
    ],
    "minimum-stability": "dev",
    "prefer-stable": true
}

I've added it locally by adding this to my root composer.json

"repositories": [
    {
      "type": "path",
      "url": "packages/mycomp/*"
    }
  ]

But when I try to install the package using composer require mycomp/livesearch I get:

Could not find a version of package mycomp/livesearch matching your minimum-stability (stable). Require it with an explicit version constraint allowing its desired stability.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽心 2025-02-20 21:09:25

修复了它。

只需要添加

"version": "1.0.0"

到我的软件包的composer.json

,尽管据我了解,这是一个坏主意,并且最好使用诸如Git之类的VC进行版本控制。但是目前,在我释放包装并将其放在Github上之前,这就足够了。

Fixed it.

Just had to add

"version": "1.0.0"

To my package's composer.json

Although, from what I've learnt this is a bad idea, and it's best to do version control with a VCS like Git. But for now, before I release the package and put it on github, this would suffice.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文