Composer - Requested Package [0.0.9] exists as [0.0.5,0.0.6] but these are rejected by your constraint(Composer - Requested Package [0.0.9] 作为 [0.0.5,0.0.6] 存在,但这些被您的约束拒绝)
问题描述
今天我在 composer 更新中遇到了一个我无法描述自己的奇怪错误.
<代码>{存储库":{我的插件":{类型":vcs","url": "git@mycodebase.com:mjplug/myplugin.git"}},要求": {我的插件/我的插件":0.0.9",}}
当我尝试 composer update
然后我会得到 p>
请求的包 my-plugin/my-plugin 0.0.9 以 my-plugin/my-plugin[0.0.6, 0.0.5] 的形式存在,但这些被您的约束拒绝.
但存储库中存在 0.0.7, 0.0.8, 0.0.9
等标签.为什么没有被发现?
如果我将 ~0.0.1
设置为版本约束,它会起作用,因为 composer 将安装 0.0.6
.
有什么提示吗?谢谢
这是我们的 Bitbucket 服务器实例的屏幕截图:http://imgur.com/a/m8lRT
编辑 2:已解决: 在最近的某个版本中,我出于某种原因将 composer.json 放到了一个子目录中.所以这就是composer找不到最新标签的问题.
因为Wordpress Plugin Files需要在子文件夹中,所以我把包括composer.json在内的所有文件都放到了子目录下,并推送了新版本.
后来我尝试在我的项目中安装新版本,但没有找到新版本.这就是问题所在.composer.json 需要在根目录下.(愚蠢的我)
有用的命令:composer show myplugin/myplugin
Today I got a strange error within a composer update
which I can't describe myself.
{
"repositories": {
"my-plugin": {
"type": "vcs",
"url": "git@mycodebase.com:mjplug/myplugin.git"
}
},
"require": {
"my-plugin/myplugin": "0.0.9",
}
}
When I try composer update
then I'll get
The requested package my-plugin/my-plugin 0.0.9 exists as my-plugin/my-plugin[0.0.6, 0.0.5] but these are rejected by your constraint.
But there exists tags like 0.0.7, 0.0.8, 0.0.9
in the repository. Why aren't they found?
If I set ~0.0.1
as version constraint it works because composer will install 0.0.6
.
Any hints? Thank you
EDIT: Here is a Screenshot of our Bitbucket Server Instance: http://imgur.com/a/m8lRT
EDIT 2: SOLVED: In some last release I put the composer.json for some reason to a sub-directory. So this was the problem that composer couldn't find the latest tags.
Because Wordpress Plugin Files need to be in a subfolder I put all files including composer.json to a subdirectory and pushed a new version.
Later I tried to install the new version inside my project and the new version(s) weren't found. This was the issue. The composer.json needs to be in root. (Stupid me)
Useful Command:
composer show myplugin/myplugin
这篇关于Composer - Requested Package [0.0.9] 作为 [0.0.5,0.0.6] 存在,但这些被您的约束拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Composer - Requested Package [0.0.9] 作为 [0.0.5,0.0.6] 存在,但这些被您的约束拒绝
基础教程推荐
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- 在多维数组中查找最大值 2021-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01