我正在尝试使用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
?
1条答案
按热度按时间gcuhipw91#
您混淆了2种不同的WordPress安装方法-
fancyguy/webroot-installer
和johnpbloch/wordpress
。选择其中一种,然后使用rm -rf vendor && composer update -v
进行全新安装。