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.

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

报告相同问题?

悬赏问题

  • ¥35 平滑拟合曲线该如何生成
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了
  • ¥15 链式存储应该如何解决
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站