doujiao1905 2013-11-16 10:50 采纳率: 100%
浏览 57
已采纳

SilverStripe作曲家版本与silverstripe / cms有关

I want to use the SilverStripe module "sheadawson/silverstripe-blocks dev-master". When i install it with composer, i was required to install some modules like multivaluefield and so fort. I installed them without a problem. Now i get the following terminal output:

Pascal@Nemesis:~/Sites/xyz$ composer require sheadawson/silverstripe-blocks dev-master
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for silverstripe/cms 1.0.0 -> satisfiable by silverstripe/cms[1.0.0].
- sheadawson/silverstripe-blocks dev-master requires silverstripe/cms 3.1.* -> satisfiable by silverstripe/cms[3.1.0, 3.1.1, 3.1.2].
- Can only install one of: silverstripe/cms[3.1.0, 1.0.0].
- Can only install one of: silverstripe/cms[3.1.1, 1.0.0].
- Can only install one of: silverstripe/cms[3.1.2, 1.0.0].
- Installation request for sheadawson/silverstripe-blocks dev-master -> satisfiable by sheadawson/silverstripe-blocks[dev-master].

I can see, that the 3.1.* dependency leads to 3 possible versions. But the 1.0.0 version of the cms entangles me a bit since i have nowhere a dependency to this version.

When i want to install version 3.1.2 with

composer require silverstripe/cms 3.1.2

i get the following output:

Pascal@Nemesis:~/Sites/xyz$ composer require silverstripe/cms 3.1.2
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for silverstripe/cms 1.0.0 -> satisfiable by silverstripe/cms[1.0.0].
- Can only install one of: silverstripe/cms[3.1.2, 1.0.0].
- Installation request for silverstripe/cms 3.1.2 -> satisfiable by silverstripe/cms[3.1.2].

The content of my composer.json file looks like that:

{
    "name": "silverstripe/cms",
    "type": "silverstripe-module",
    "description": "The SilverStripe Content Management System",
    "homepage": "http://silverstripe.org",
    "license": "BSD-3-Clause",
    "keywords": ["silverstripe", "cms"],
    "authors": [
        {
            "name": "SilverStripe",
            "homepage": "http://silverstripe.com"
        },
        {
            "name": "The SilverStripe Community",
            "homepage": "http://silverstripe.org"
        }
    ],
    "require": {
        "php": ">=5.3.2",
        "ajshort/silverstripe-gridfieldextensions": "dev-master",
        "silverstripe/multivaluefield": "dev-master"
    }
}

Does anybody know why composer wants to install version 1.0.0 of the cms as well? I tried already removing all modules, cleaning the composer.json, removing the composer.lock, composer update and everything else that came to my mind.

  • 写回答

1条回答 默认 最新

  • duanraotun1674 2013-11-16 11:52
    关注

    That composer.json of yours does look like it is the file from that CMS, not from your own software.

    And if that is the case, it does not surprise me that Composer is confused. In that composer.json you state that "silverstripe/cms" is YOUR software. And if you tagged your software as version 1.0.0, you created "silverstripe/cms 1.0.0" - any required software that needs a higher version cannot work now.

    Generally, if you start using Composer, it is good idea to run composer init in the main directory of your software and then answer some questions about YOUR software interactively.

    In the most basic case, you create an empty file composer.json, and add a pair of curly braces, and then fill in a "require" key and the software needed.

    What you should NEVER do: Copy the composer.json from anyone else without fixing all the issues. I don't know what you did to grab your current version, but I guess you probably cloned some repository to get your project started. That's not completely wrong - but somebody should improve that workflow then to avoid getting in trouble with Composer.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.