Composer-请求的程序包[0.0.9]以[0.0.5,0.0.6]的形式存在,但这些被您的约束拒绝 [英] Composer - Requested Package [0.0.9] exists as [0.0.5,0.0.6] but these are rejected by your constraint
问题描述
今天,我在作曲家更新
中遇到了一个奇怪的错误,我无法形容自己。
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",
}
}
当我尝试撰写者更新时
然后我会得到
所请求的软件包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
。他们为什么找不到?
But there exists tags like 0.0.7, 0.0.8, 0.0.9
in the repository. Why aren't they found?
如果我将〜0.0.1
设置为版本约束,则它会起作用,因为composer将安装 0.0.6
。
If I set ~0.0.1
as version constraint it works because composer will install 0.0.6
.
有任何提示吗?谢谢
编辑:这是我们的Bitbucket服务器实例的屏幕截图: http://imgur.com/a/m8lRT
Here is a Screenshot of our Bitbucket Server Instance: http://imgur.com/a/m8lRT
编辑2:已解决:由于某种原因将composer.json移到子目录。因此,这就是作曲家找不到最新标签的问题。
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.
推荐答案
因为Wordpress插件文件需要放在子文件夹中我将包括composer.json在内的所有文件放到一个子目录中,并推送了一个新版本。
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.
后来,我尝试在项目中安装新版本和新版本。找不到。这就是问题所在。 composer.json需要在根目录中。 (愚蠢的我)
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)
有用的命令:
composer show myplugin / myplugin
这篇关于Composer-请求的程序包[0.0.9]以[0.0.5,0.0.6]的形式存在,但这些被您的约束拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!