【问题标题】:composer error while composer install and composer update? [duplicate]作曲家安装和作曲家更新时作曲家错误? [复制]
【发布时间】:2021-08-07 09:07:33
【问题描述】:

运行 composer install 时出现以下错误,

Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - laminas/laminas-dependency-plugin is locked to version 1.0.4 and an update of this package was not requested.
    - laminas/laminas-dependency-plugin 1.0.4 requires composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
  Problem 2
    - magento/composer-root-update-plugin is locked to version 1.0.0 and an update of this package was not requested.
    - magento/composer-root-update-plugin 1.0.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
  Problem 3
    - magento/inventory-composer-installer is locked to version 1.1.0 and an update of this package was not requested.
    - magento/inventory-composer-installer 1.1.0 requires composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
  Problem 4
    - magento/magento-composer-installer is locked to version 0.1.13 and an update of this package was not requested.
    - magento/magento-composer-installer 0.1.13 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
  Problem 5
    - dealerdirect/phpcodesniffer-composer-installer is locked to version v0.5.0 and an update of this package was not requested.
    - dealerdirect/phpcodesniffer-composer-installer v0.5.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
  Problem 6
    - magento/magento-composer-installer 0.1.13 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - magento/product-community-edition 2.4.1 requires magento/magento-composer-installer >=0.1.11 -> satisfiable by magento/magento-composer-installer[0.1.13].
    - magento/product-community-edition is locked to version 2.4.1 and an update of this package was not requested.

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

那么如果我总是运行 composer update 下面的错误,

Loading composer repositories with package information
https://repo.magento.com could not be fully loaded (Unable to use a proxy: malformed http_proxy url), package information was loaded from the local cache and may be out of date


  [Composer\Downloader\TransportException]
  Unable to use a proxy: malformed http_proxy url


update [--with WITH] [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-autoloader] [--no-scripts] [--no-suggest] [--no-progress] [-w|--with-dependencies] [-W|--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-s

【问题讨论】:

  • @NicoHaase 可以回答吗
  • 回答什么?你有什么尝试自己解决问题?你被困在哪里了?
  • 克隆作曲家安装后,如果我运行它给出以下错误,
  • [Composer\Downloader\TransportException] 无法使用代理:格式错误的 http_proxy url 这个错误@NicoHaase

标签: php composer-php magento2


【解决方案1】:

这是您缺少的主要信息:

laminas/laminas-dependency-plugin 1.0.4 requires composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match the constraint

它告诉您正在使用 Composer v2,而您的某些软件包仍然需要 Composer v1。您应该将 Composer 降级到 v1,或者升级软件包。

可以通过composer update laminas/laminas-dependency-plugin magento/composer-root-update-plugin之类的方式进行选择性升级

【讨论】:

    猜你喜欢
    • 2016-01-08
    • 1970-01-01
    • 2013-09-07
    • 2018-10-21
    • 2017-03-13
    • 2015-09-11
    • 2017-06-02
    • 2016-05-20
    相关资源
    最近更新 更多