【问题标题】:Couldn't install packages using composer无法使用 Composer 安装软件包
【发布时间】:2018-10-11 18:35:15
【问题描述】:

我是 php 和 drupal 世界的新手。我正在尝试在本地运行我们的 drupal 应用程序。我已经安装了作曲家。还已将最低稳定性配置为 dev。当我尝试跑步时 composer install,我收到以下错误: 在任何版本中都找不到请求的包 package_name,包名可能有拼写错误。 它会为所有包引发错误。

{
    "name": "aws/drupal",
    "description": "Project template for Drupal 8 sites built with BLT.",
    "type": "project",
    "minimum-stability": "dev",
    "prefer-stable": true,
    "require": {
        "acquia/blt": "^8.8",
        "composer/installers": "^1.0.24",
        "wikimedia/composer-merge-plugin": "~1.3",
        "drupal/pathauto": "^1.0",
        "drupal/viewfield": "3.x-dev",
        "drupal/easy_breadcrumb": "^1.0",
        "drupal/paragraphs": "^1.1",
        "drupal/token": "^1.0",
        "drupal/video_embed_field": "^1.5",
        "drupal/ctools": "^3.0",
        "drupal/google_analytics": "2.1",
        "drupal/entity_reference_revisions": "^1.3",
        "drupal/views_infinite_scroll": "^1.3",
        "drupal/field_group": "~1.0",
        "drupal/addtoany": "^1.8",
        "drupal/colorbox": "^1.4",
        "drupal/features": "^3.5",
        "drupal/rabbit_hole": "~1.0",
        "drupal/redirect": "~1.0",
        "drupal/honeypot": "~1.0",
        "drupal/maxlength": "1.x-dev",
        "drupal/menu_link_attributes": "^1@beta",
        "drupal/cog": "^1.8",
        "jackmoore/colorbox": "^1.6",
        "stevenwanderski/bxslider-4": "^4.2",
        "matthieua/WOW": "^1.1",
        "drupal/csv_serialization": "^1.0",
        "drupal/contact_storage_export": "^1.10",
        "drupal/contact_block": "~1.0",
        "drupal/require_login": "~1.0",
        "drupal/linkit": "^4.3",
        "drupal/menu_trail_by_path": "^1.1",
        "drupal/link_attributes": "^1.1",
        "drupal/migrate_plus": "^4.0",
        "drupal/migrate_tools": "^4.0",
        "drupal/ubercart": "^4.0",
        "drupal/better_exposed_filters": "^3.0@alpha",
        "drupal/uc_stripe": "^2.0@alpha"
    },
    "require-dev": {},
    "extra": {
        "enable-patching": true,
        "installer-paths": {
            "docroot/core": [
                "type:drupal-core"
            ],
            "docroot/modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "docroot/modules/custom/{$name}": [
                "type:drupal-custom-module"
            ],
            "docroot/profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "docroot/profiles/custom/{$name}": [
                "type:drupal-custom-profile"
            ],
            "docroot/themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "docroot/themes/custom/{$name}": [
                "type:drupal-custom-theme"
            ],
            "docroot/libraries/{$name}": [
                "type:drupal-library",
                "type:bower-asset",
                "type:npm-asset"
            ],
            "drush/contrib/{$name}": [
                "type:drupal-drush"
            ]
        },
        "merge-plugin": {
            "require": [
                "vendor/acquia/blt/composer.required.json",
                "vendor/acquia/blt/composer.suggested.json"
            ],
            "include": [
                "blt/composer.overrides.json"
            ],
            "merge-extra": true,
            "merge-extra-deep": true,
            "merge-scripts": true,
            "replace": true
        },
        "patches": {
            "drupal/core": {
                "Contextual links broken fix": "https://www.drupal.org/files/issues/contextual_links_broken-2033275-10.patch"
            },
            "drupal/ubercart": {
                "Call to a member function label() on null": "https://www.drupal.org/files/issues/ubercart.call_to_a_member-2788963-10.patch"
            }
        },
        "installer-types": [
            "bower-asset",
            "npm-asset"
        ]
    },
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "jackmoore/colorbox",
                "version": "1.6.4",
                "type": "drupal-library",
                "dist": {
                    "url": "https://github.com/jackmoore/colorbox/archive/master.zip",
                    "type": "zip"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "stevenwanderski/bxslider-4",
                "version": "4.2.12",
                "type": "drupal-library",
                "dist": {
                    "url": "https://github.com/stevenwanderski/bxslider-4/archive/master.zip",
                    "type": "zip"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "matthieua/WOW",
                "version": "1.1.3",
                "type": "drupal-library",
                "dist": {
                    "url": "https://github.com/matthieua/WOW/archive/master.zip",
                    "type": "zip"
                }
            }
        }
    ]
} 

谢谢。

【问题讨论】:

  • 你能解释一下你正在尝试哪个包并为它命令吗?
  • 我正在使用安装命令:composer install。我正在尝试安装以下依赖项:“require”:{“acquia/blt”:“^8.8”,“composer/installers”:“^1.0.24”,“wikimedia/composer-merge-plugin”:“~1.3 ", "drupal/pathauto": "^1.0" }
  • 请分享您的composer.json 文件的内容。
  • 我通过编辑我的问题添加了。请看一看。谢谢。
  • 嗨。显然我必须删除供应商目录并重新运行作曲家安装。即解决问题。感谢您的帮助。

标签: php drupal composer-php


【解决方案1】:

显然问题是我在克隆 repo 时有旧的依赖项。我不得不删除供应商目录并重新运行 composer install 命令。这解决了问题。

【讨论】:

    猜你喜欢
    • 2022-06-18
    • 2020-01-11
    • 2020-03-22
    • 2015-05-23
    • 2022-10-14
    • 2020-08-14
    • 2019-04-21
    • 2018-09-01
    • 2017-07-19
    相关资源
    最近更新 更多