简体   繁体   English

无效的版本字符串“*”

[英]Invalid version string "*"

Here is the line that causes the issue:这是导致问题的行:

"config": {
    "platform": {
        "ext-calendar": "*"
    }
},

And on composer update it results in a Invalid version string "*"composer update它会导致Invalid version string "*"

Composer version: 1.9.3作曲家版本: 1.9.3

Tried to remove the vendor and re-install everything, but same results.试图删除vendor并重新安装所有内容,但结果相同。

In your composer.json, you can add platform into your config, to force it to resolve dependencies to a specific version of PHP.在您的 composer.json 中,您可以将平台添加到您的配置中,以强制它解析特定版本的 PHP 的依赖关系。

https://getcomposer.org/doc/06-config.md#platform https://getcomposer.org/doc/06-config.md#platform

"config": {
    "platform": {
        "php": "5.6"
    },
},

You use this platform key if for example your dev machine has a different version of PHP than your actual server, so that composer resolves the dependencies to the specific version.例如,如果您的开发机器的 PHP 版本与您的实际服务器不同,则您可以使用此平台密钥,以便 composer 将依赖项解析为特定版本。 This means having * in here doesn't make sense.这意味着这里有*没有意义。 Also, that's a PHP extension, not a PHP version, so it just belongs in the normal require section, where a * is accepted.此外,这是一个 PHP 扩展,而不是 PHP 版本,所以它只属于正常的 require 部分,其中接受*

Either delete that section, or lock down an actual PHP number, and you should be good to go.要么删除该部分,要么锁定一个实际的 PHP 编号,这样就可以了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM