Closed fancyecommerce closed 4 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)
Installing scrivo/highlight.php (v8.9.1)
Downloading: 100%
Installing mikevanriel/text-to-latex (1.0.1) Downloading: 100%
Removing cebe/markdown (1.1.1)
Installing cebe/markdown (1.0.2) Downloading: 100%
Installing cebe/markdown-latex (1.1.3) Downloading: 100%
Installing cebe/js-search (0.9.3) Downloading: 100%
Installing nikic/php-parser (v0.9.5) Downloading: 100%
Installing phpdocumentor/reflection (1.0.7) Downloading: 100%
Installing yiisoft/yii2-apidoc (2.0.6) Downloading: 100%
Writing lock file Generating autoload files
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.
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.
but if
can you show your 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-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"
}
}
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?
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
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.
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?
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 ?
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
.
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.
@neoacevedo Could you upload your composer.json
and compose.lock
as gist?
https://github.com/neoacevedo/openbiblio2
I am trying to use yii2-apidoc for building the document site just like Yiiframework API doc.
Good, I have uninstalled globally fxp/composer-asset-plugin, cleaned cache and installed again globally composer-asset-plugin and worked.
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
I was able to reproduce it, see above issue for details.
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.
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.