我们正在努力让所有未使用Composer安装的Drupal模块在Composer中进行管理。
清除Composer的缓存后,我们运行了以下内容:
./composer require dompdf/dompdf;
返回:
./composer.json has been updated
> DrupalProject\composer\ScriptHandler::checkComposerVersion
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: phenx/php-svg-lib[v0.2, 0.1].
- Can only install one of: phenx/php-svg-lib[v0.2, 0.1].
- Can only install one of: phenx/php-svg-lib[v0.2, 0.1].
- dompdf/dompdf v0.8.0 requires phenx/php-svg-lib 0.2.* -> satisfiable by phenx/php-svg-lib[v0.2].
- Installation request for dompdf/dompdf ^0.8.0 -> satisfiable by dompdf/dompdf[v0.8.0].
- Installation request for phenx/php-svg-lib (locked at 0.1) -> satisfiable by phenx/php-svg-lib[0.1].
Installation failed, reverting ./composer.json to its original content.
似乎正确的做法是不将“phenx / php-svg-lib”锁定到版本0.1,然后升级dompdf,但是当我们修改dompdf的composer.json文件以要求phenx / php-svg- lib版本0.2。*,clearcache,然后再次尝试require,我们得到与上面相同的错误,它仍然引用了0.1的锁定。我还确认dompdf是唯一使用phenx / php-svg-lib的供应商模块。
另外,有没有理由为“只能安装其中一个”列出三次?
提前感谢您的任何建议。
答案 0 :(得分:4)
将dompdf
从版本0.7.0
更新为0.8.0
时,似乎会出现此问题。出于某种原因,更新对于作曲家1.2.x
完全正常,但导致版本为1.4.x
时出现上述错误。
为我完成这项工作的修复方法是删除
"dompdf/dompdf": "^0.7.0"
来自composer.json
文件,然后运行:
composer update
结果应该是这样的:
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 0 updates, 3 removals
- Removing dompdf/dompdf (v0.7.0)
- Removing phenx/php-font-lib (0.4)
- Removing phenx/php-svg-lib (0.1)
Writing lock file
Generating autoload files
然后需要新版本:
composer require dompdf/dompdf