编写器没有使用通配符获得最新版本


Composer not getting the most up to date version with wildcard

我有一个Composer包,需要OtherPackage vs . 1.0.*。我知道1.0.3版本存在,但它一直在下载1.0.1版本。我不明白为什么它没有得到最新的版本。

我的作曲家。json文件:

"require": {
   "MyVendor/OtherPackage": "1.0.*",
}

我发现了这个问题,因为我试图强制1.0.3版本,并得到以下错误:

Your requirements could not be resolved to an installable set of packages.
    - Installation request for myVendor/OtherPackage 1.0.3 -> satisfiable by MyVendor/OtherPackage[1.0.3]
    - MyVendor/OtherPackage 1.0.3 requires OtherVendor/ThirdPackage 1.0.1 -> no matching package found.

所以这是当我想起MyVendor/OtherPackage 1.0.1没有ThirdPackage依赖,而1.0.2和1.0.3有。我没有在我的作曲器中包含ThirdPackage。json的要求。因此,Composer足够聪明,可以获得最新版本的OtherPackage,它可以满足我当前所有的依赖。

我的解决方案是将OtherVendor/ThirdPackage 1.0.1添加到composer.json中的require声明中。

My new composer.json

"require": {
   "MyVendor/OtherPackage": "1.0.*",
   "OtherVendor/ThridPackage":"1.0.1"
},