wordpress 很抱歉只能将一个包安装到配置的webroot中

0vvn1miw  于 2023-03-07  发布在  WordPress
关注(0)|答案(1)|浏览(109)

我正在尝试使用composer install来安装WordPress核心和一些插件,使用自定义目录结构。这似乎不是一个最佳实践,但我需要安装这个本地原样,以测试在服务器上更改它。
目前,composer install给我一个错误。
[参数无效异常]
抱歉,只能将一个程序包安装到配置的webroot中。
我不 * 认为 * 这是试图安装一个以上的软件包在webroot。我以为它只是安装WordPress核心在webroot。
这是我的 composer json:

{
  "name": "mrengy/emandminbeantown",
  "description": "Em and M in Beantown Blog",

  "require": {
    "wordpress/wordpress": "5.8.*",
    "wpackagist-plugin/akismet": "*",
    "wpackagist-plugin/broken-link-checker": "*",
    "wpackagist-plugin/degradable-html5-audio-and-video": "*",
    "wpackagist-plugin/display-php-version": "*",
    "wpackagist-plugin/enable-media-replace": "*",
    "wpackagist-plugin/fitvids-for-wordpress": "*",
    "wpackagist-plugin/fix-image-rotation": "*",
    "wpackagist-plugin/jetpack": "*",
    "wpackagist-plugin/mailchimp-for-wp": "*",
    "wpackagist-plugin/media-element-html5-video-and-audio-player": "*",
    "wpackagist-plugin/postie": "*",
    "wpackagist-plugin/regenerate-thumbnails": "*",
    "wpackagist-plugin/simple-top-commenters": "*",
    "wpackagist-plugin/video-embed-thumbnail-generator": "*",
    "wpackagist-plugin/w3-total-cache": "*",
    "wpackagist-plugin/classic-editor": "*"
  },
  "repositories":[
      {
          "type":"composer",
          "url":"https://wpackagist.org"
      },
      {
        "type"    : "package",
        "package" : {
          "name"    : "wordpress/wordpress",
          "type"    : "webroot",
          "version" : "5.8",
          "dist"    : {
            "url"  : "https://github.com/WordPress/WordPress/archive/5.8.zip",
            "type" : "zip"
          },
          "source" : {
            "url"       : "https://github.com/WordPress/WordPress",
            "type"      : "git",
            "reference" : "5.8"
          },
          "require" : {
            "fancyguy/webroot-installer" : "1.0.0"
          }
        }
      }
  ],
  "autoload": {
      "psr-0": {
          "Acme": "src/"
      }
  },
  "config"      : {
      "vendor-dir": "content/vendor",
      "allow-plugins": {
      "johnpbloch/wordpress-core-installer": true,
      "composer/installers": true,
      "fancyguy/webroot-installer": true
    }
  },
  "extra" : {
    "installer-paths": {
      "content/plugins/{$name}/": ["type:wordpress-plugin"],
      "content/themes/{$name}/": ["type:wordpress-theme"]
    },
    "webroot-dir"     : "wp",
    "webroot-package" : "wordpress",
    "wordpress-install-dir": "wp"
  }
}

奇怪的是,在另一个repo中,我能够在一个非常相似的composer.json上运行composer install而没有任何错误。

{
  "name": "mrengy/mike-eng.com",
  "description": "personal website",
  "require": {
    "johnpbloch/wordpress": "5.8.*",
    "wpackagist-plugin/akismet": "*",
    "wpackagist-plugin/broken-link-checker": "*",
    "wpackagist-plugin/email-address-encoder": "*",
    "wpackagist-plugin/enable-media-replace": "*",
    "wpackagist-plugin/image-rotation-fixer": "*",
    "wpackagist-plugin/jetpack": "*",
    "wpackagist-plugin/kimili-flash-embed": "*",
    "wpackagist-plugin/manual-image-crop": "*",
    "wpackagist-plugin/show-current-template": "*",
    "wpackagist-plugin/syntax-highlighter": "*",
    "wpackagist-plugin/wpaudio-mp3-player": "*",
    "wpackagist-plugin/wp-retina-2x": "*"
  },
  "require-dev": {
    "wpackagist-plugin/debug-bar": "*",
    "wpackagist-plugin/debug-bar-console": "*",
    "wpackagist-plugin/wordpress-importer": "*"
  },
  "repositories":[
      {
          "type":"composer",
          "url":"https://wpackagist.org"
      },
      {
        "type"    : "package",
        "package" : {
          "name"    : "wordpress",
          "type"    : "webroot",
          "version" : "5.8",
          "dist"    : {
            "url"  : "https://github.com/WordPress/WordPress/archive/5.7.zip",
            "type" : "zip"
          },
          "source" : {
            "url"       : "https://github.com/WordPress/WordPress",
            "type"      : "git",
            "reference" : "5.8"
          },
          "require" : {
            "fancyguy/webroot-installer" : "1.0.0"
          }
        }
      }
  ],
  "autoload": {
      "psr-0": {
          "Acme": "src/"
      }
  },
  "config"      : {
      "vendor-dir": "content/vendor"
  },
  "extra" : {
    "installer-paths": {
      "content/plugins/{$name}/": ["type:wordpress-plugin"],
      "content/themes/{$name}/": ["type:wordpress-theme"]
    },
    "webroot-dir"     : "wp",
    "webroot-package" : "wordpress",
    "wordpress-install-dir": "wp",
    "dropin-paths": {
      "content/languages/": ["vendor:koodimonni-language"],
      "content/languages/plugins/": ["vendor:koodimonni-plugin-language"],
      "content/languages/themes/": ["vendor:koodimonni-theme-language"]
    }
  }
}

我在Composer v 1.10.26(full terminal output)和Composer v 2.2.7(full terminal output)上得到了相同的错误
如何成功修复此问题和composer install

gcuhipw9

gcuhipw91#

您混淆了2种不同的WordPress安装方法-fancyguy/webroot-installerjohnpbloch/wordpress。选择其中一种,然后使用rm -rf vendor && composer update -v进行全新安装。

相关问题