简体   繁体   English

无法解析版本约束

[英]Could not parse version constraint

I can't add a class( Jalali DateTime Class for PHP ) to my project and have an我无法在我的项目中添加一个类( Jalali DateTime Class for PHP )并且有一个

ERROR: [UnexpectedValueException]
Could not parse version constraint :dev-master: Invalid version string ":dev-master"

Can anyone help me?谁能帮我? Thanks in advance.提前致谢。

You somehow managed to sneak in a colon " : " into the branch name, and this confuses Composer.您不知何故设法将冒号“ : ”潜入分支名称中,这让 Composer 感到困惑。

Remove the colon, and it should work.删除冒号,它应该可以工作。 However, please take the comment from above into consideration:但是,请考虑上面的评论:

  1. If the library isn't maintained anymore: Look for alternatives now before you start using it.如果库不再维护:在开始使用它之前立即寻找替代方案。 It is the most convenient time to do.这是最方便的时间。
  2. Do not require "dev-master" at all, always require a tagged and released version.根本不需要“dev-master”,总是需要一个标记和发布的版本。 This will make your life much easier later on, when you add more dependencies and maybe update them.当您添加更多依赖项并可能更新它们时,这将使您的生活更加轻松。

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

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