无法通过 Drupal 8 中的 Composer 更新 dompdf
Unable to update dompdf via Composer in Drupal 8
我们正在尝试让所有未使用 Composer 安装的 Drupal 模块在 Composer 中进行管理。
- 作曲家:1.4.12
- Drupal: 8.3.1
清除 Composer 的缓存后,我们 运行 以下内容:
./composer require dompdf/dompdf;
这个returns:
./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.
的供应商模块
另外,"Can only install one of"被列了3次是什么原因?
提前感谢您的任何建议。
似乎将 dompdf
从版本 0.7.0
更新到 0.8.0
时会出现此问题。出于某种原因,更新在 composer 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
我们正在尝试让所有未使用 Composer 安装的 Drupal 模块在 Composer 中进行管理。
- 作曲家:1.4.12
- Drupal: 8.3.1
清除 Composer 的缓存后,我们 运行 以下内容:
./composer require dompdf/dompdf;
这个returns:
./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.
的供应商模块另外,"Can only install one of"被列了3次是什么原因?
提前感谢您的任何建议。
似乎将 dompdf
从版本 0.7.0
更新到 0.8.0
时会出现此问题。出于某种原因,更新在 composer 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