yiisoft / yii2-apidoc

Yii 2 apidoc extension.
https://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
258 stars 121 forks source link

install error #123

Closed fancyecommerce closed 4 years ago

fancyecommerce commented 7 years ago

Using version ^2.1 for yiisoft/yii2-apidoc ./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 failed, reverting ./composer.json to its original content.

fancyecommerce commented 7 years ago

if i install "yiisoft/yii2-apidoc": "~2.0.0", install success, install log: [root@localhost tadoc]# composer update Do not run Composer as root/super user! See https://getcomposer.org/root for details Loading composer repositories with package information

Updating dependencies (including require-dev)

Writing lock file Generating autoload files

fancyecommerce commented 7 years ago

if i use composer require --prefer-dist yiisoft/yii2-apidoc it install "yiisoft/yii2-apidoc": "~2.1.0"

will be error:

[root@localhost tadoc]# composer require --prefer-dist yiisoft/yii2-apidoc Do not run Composer as root/super user! See https://getcomposer.org/root for details Using version ^2.1 for yiisoft/yii2-apidoc ./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 failed, reverting ./composer.json to its original content.

cebe commented 7 years ago

the thing with require is that it will only touch one package and will not upgrade other packages. You should update your composer.json and then run composer update.

cebe commented 7 years ago

See https://github.com/yiisoft/yii2-apidoc#installation

fancyecommerce commented 7 years ago
  1. add code: "yiisoft/yii2-apidoc": "~2.1.0" to composer.json
  2. run : composer update then show error

but if

  1. add code: "yiisoft/yii2-apidoc": "~2.0.0" to composer.json
  2. run : composer update then show success
cebe commented 7 years ago

can you show your composer.json?

fancyecommerce commented 7 years ago
{
    "name": "yiisoft/yii2-app-advanced",
    "description": "Yii 2 Advanced Project Template",
    "keywords": ["yii2", "framework", "advanced", "project template"],
    "homepage": "http://www.yiiframework.com/",
    "type": "project",
    "license": "BSD-3-Clause",
    "support": {
        "issues": "https://github.com/yiisoft/yii2/issues?state=open",
        "forum": "http://www.yiiframework.com/forum/",
        "wiki": "http://www.yiiframework.com/wiki/",
        "irc": "irc://irc.freenode.net/yii",
        "source": "https://github.com/yiisoft/yii2"
    },
    "minimum-stability": "stable",
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2-apidoc": "~2.0.0",
        "yiisoft/yii2": "~2.0.6",
        "yiisoft/yii2-bootstrap": "~2.0.0",
        "yiisoft/yii2-swiftmailer": "~2.0.0"
    },
    "require-dev": {
        "yiisoft/yii2-debug": "~2.0.0",
        "yiisoft/yii2-gii": "~2.0.0",
        "yiisoft/yii2-faker": "~2.0.0",

        "codeception/base": "^2.2.3",
        "codeception/verify": "~0.3.1"
    },
 "config": {
        "process-timeout": 1800
    },
    "extra": {
        "asset-installer-paths": {
            "npm-asset-library": "vendor/npm",
            "bower-asset-library": "vendor/bower"
        }
    },
    "scripts": {
        "post-install-cmd": "php init --env=Development --overwrite=n"
    }
}
bin-x commented 7 years ago

I have the same problem. version ^2.1 for yiisoft/yii2-apidoc require "cebe/markdown-latex": "~1.0", "cebe/markdown-latex": "~1.0" require "cebe/markdown": "~1.0.0", but the last stable version for "cebe/markdown" is 1.1.1
I wonder if the unmatching of the version is the reason for this problem?

frixou89 commented 7 years ago

Had the same issue. I did the following and manged to install

Add "yiisoft/yii2-apidoc": "~2.1.0" to composer.json

Then update composer

composer self-update

Then

composer update

cebe commented 7 years ago

version ^2.1 for yiisoft/yii2-apidoc require "cebe/markdown-latex": "~1.0", "cebe/markdown-latex": "~1.0" require "cebe/markdown": "~1.0.0", but the last stable version for "cebe/markdown" is 1.1.1 I wonder if the unmatching of the version is the reason for this problem?

composer should just downgrade cebe/markdown if you do not have any constrains that avoid it.

damiankosiorowski commented 7 years ago

Problem during installation:

composer require --prefer-dist yiisoft/yii2-apidoc Using version ^2.1 for yiisoft/yii2-apidoc ./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

  • Can only install one of: phpdocumentor/reflection-docblock[2.0.4, 3.1.1].
  • Can only install one of: phpdocumentor/reflection-docblock[3.1.1, 2.0.4].
  • Can only install one of: phpdocumentor/reflection-docblock[2.0.4, 3.1.1].
  • yiisoft/yii2-apidoc 2.1.0 requires phpdocumentor/reflection-docblock ^2.0.4 -> satisfiable by phpdocumentor/reflection-docblock[2.0.4].
  • Installation request for yiisoft/yii2-apidoc ^2.1 -> satisfiable by yiisoft/yii2-apidoc[2.1.0].
  • Installation request for phpdocumentor/reflection-docblock (locked at 3.1.1) -> satisfiable by phpdocumentor/reflection-docblock[3.1.1]. Installation failed, reverting ./composer.json to its original content.

My composer.json

{ "name": "yiisoft/yii2-app-advanced", "description": "Yii 2 Advanced Project Template", "keywords": ["yii2", "framework", "advanced", "project template"], "homepage": "http://www.yiiframework.com/", "type": "project", "license": "BSD-3-Clause", "support": { "issues": "https://github.com/yiisoft/yii2/issues?state=open", "forum": "http://www.yiiframework.com/forum/", "wiki": "http://www.yiiframework.com/wiki/", "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, "minimum-stability": "stable", "require": { "php": ">=5.4.0", "yiisoft/yii2": "~2.0.6", "yiisoft/yii2-bootstrap": "~2.0.0", "yiisoft/yii2-swiftmailer": "~2.0.0", "toriphes/yii2-console-runner": "", "kartik-v/yii2-password": "@dev", "kartik-v/yii2-widgets": "", "kartik-v/yii2-dialog": "", "kartik-v/yii2-grid": "@dev", "kartik-v/yii2-detail-view": "", "phpoffice/phpexcel": "", "yarisrespect/yii2-excel": "@dev", "kartik-v/yii2-field-range": "" }, "require-dev": { "yiisoft/yii2-debug": "~2.0.0", "yiisoft/yii2-gii": "~2.0.0", "yiisoft/yii2-faker": "~2.0.0", "codeception/base": "^2.2.3", "codeception/verify": "~0.3.1" }, "config": { "process-timeout": 1800 }, "extra": { "asset-installer-paths": { "npm-asset-library": "vendor/npm", "bower-asset-library": "vendor/bower" } }, "scripts": { "post-install-cmd": "php init --env=Development --overwrite=n" } }

Any suggestions?

neoacevedo commented 6 years ago

Wow, this bug has 1 year without solve it. The problem comes from cebe/markdown declaration in composer.json: "cebe/markdown": "~1.0.0 | ~1.1.0", The problem says that "only one cebe/markdown can be installed", so what happens if it is changed from ~1.0.0 | ~1.1.0 to ^1.1 ?

schmunk42 commented 6 years ago

Anyone seeing this issue should try to add one of the following options to composer require

--update-with-dependencies: Also update dependencies of the newly required packages, except those that are root requirements. --update-with-all-dependencies: Also update dependencies of the newly required packages, including those that are root requirements.

https://getcomposer.org/doc/03-cli.md#require

As pointed out by @cebe composer is trying to do a minimal update during require and does not update other packages until you tell it to do so.

@neoacevedo The declaration is fine. It's like >=1.0.0 <1.2.0, while your proposal would be >=1.1.0 <2.0.0.

neoacevedo commented 6 years ago

Good, to me, I recently updated everything before try to install this extension, but I get the same result:

composer.phar require --update-with-dependencies  yiisoft/yii2-apidoc                                                             
Using version ^2.1 for yiisoft/yii2-apidoc                                                                                                                                              
./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 yiisoft/yii2-apidoc ^2.1 -> satisfiable by yiisoft/yii2-apidoc[2.1.0].
    - Conclusion: remove cebe/markdown 1.1.2
    - Conclusion: don't install cebe/markdown 1.1.2
    - yiisoft/yii2-apidoc 2.1.0 requires cebe/markdown-latex ~1.0 -> satisfiable by cebe/markdown-latex[1.0.0, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4].
    - cebe/markdown-latex 1.0.0 requires cebe/markdown ~1.0.0 -> satisfiable by cebe/markdown[1.0.0, 1.0.1, 1.0.2, 1.0.3].
    - cebe/markdown-latex 1.1.0 requires cebe/markdown ~1.0.0 -> satisfiable by cebe/markdown[1.0.0, 1.0.1, 1.0.2, 1.0.3].
    - cebe/markdown-latex 1.1.1 requires cebe/markdown ~1.0.0 -> satisfiable by cebe/markdown[1.0.0, 1.0.1, 1.0.2, 1.0.3].
    - cebe/markdown-latex 1.1.2 requires cebe/markdown ~1.0.0 -> satisfiable by cebe/markdown[1.0.0, 1.0.1, 1.0.2, 1.0.3].
    - cebe/markdown-latex 1.1.3 requires cebe/markdown ~1.0.0 -> satisfiable by cebe/markdown[1.0.0, 1.0.1, 1.0.2, 1.0.3].
    - cebe/markdown-latex 1.1.4 requires cebe/markdown ~1.0.0 -> satisfiable by cebe/markdown[1.0.0, 1.0.1, 1.0.2, 1.0.3].
    - Can only install one of: cebe/markdown[1.0.0, 1.1.2].
    - Can only install one of: cebe/markdown[1.0.1, 1.1.2].
    - Can only install one of: cebe/markdown[1.0.2, 1.1.2].
    - Can only install one of: cebe/markdown[1.0.3, 1.1.2].
    - Installation request for cebe/markdown (locked at 1.1.2) -> satisfiable by cebe/markdown[1.1.2].

Installation failed, reverting ./composer.json to its original content.
schmunk42 commented 6 years ago

@neoacevedo Could you upload your composer.json and compose.lock as gist?

neoacevedo commented 6 years ago

https://github.com/neoacevedo/openbiblio2

I am trying to use yii2-apidoc for building the document site just like Yiiframework API doc.

neoacevedo commented 6 years ago

Good, I have uninstalled globally fxp/composer-asset-plugin, cleaned cache and installed again globally composer-asset-plugin and worked.

schmunk42 commented 6 years ago

https://github.com/neoacevedo/openbiblio2

This has no .lock file, so I can't really debug your issue. I can install the lib via composer + asset-plugin.




"Truly" related: https://github.com/composer/composer/issues/6661
schmunk42 commented 6 years ago

I was able to reproduce it, see above issue for details.

bizley commented 4 years ago

Since the problem lies on the composer side (and it cannot be fixed there simply) and some solutions were given already here and in https://github.com/composer/composer/issues/7261 I'm closing it.