Package "drupal/core" is not installed

huangapple go评论82阅读模式
英文:

Package "drupal/core" is not installed

问题

我已经在本地(使用Windows 10上的Wampserver和PHP 8.1.13)传输了我的现有Drupal 9网站的备份版本。文件位于子文件夹C:/wamp64/www/BDV-dev中。我创建了一个数据库("bdv_dev")并编辑了settings.php以链接到它:

$databases['default']['default'] = array (
  'database' => 'bdv_dev',
  'username' => 'root',
  'password' => '',
  'prefix' => '',
  'host' => 'localhost',
  'port' => '3306',
  'driver' => 'mysql',
  'collation' => 'utf8mb4_general_ci',
  'init_commands' => [
    'isolation_level' => 'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED',
  ],
);

当我本地连接到我的网站时(在Wamp上正确配置了虚拟主机),它要求我运行安装过程,这是成功的。

然后,我尝试使用命令"drush sql-cli < dev.sql"导入我的现有数据库备份(位于我的项目子文件夹中的"dev.sql"文件),但我收到以下错误消息:

[preflight] 包 "drupal/core" 未安装

这发生在所有drush命令(status、cr等)中,我找不到关于这个特定错误消息的任何信息...

我已使用"composer update -W"更新了所有模块/扩展。

这是我的composer.json文件:

{
    "name": "drupal/recommended-project",
    "description": "Project template for Drupal projects with a relocated document root",
    "type": "project",
    "license": "GPL-2.0-or-later",
    "homepage": "https://www.drupal.org/project/drupal",
    "support": {
        "docs": "https://www.drupal.org/docs/user_guide/en/index.html",
        "chat": "https://www.drupal.org/node/314178"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ],
    "require": {
        "commerceguys/addressing": "^1.4",
        "composer/installers": "^2.2",
        "cweagans/composer-patches": "^1.7",
        "doctrine/collections": "^1.2",
        "drupal/address": "^1.11",
        "drupal/address_autocomplete": "^1.0@beta",
        "drupal/admin_toolbar": "^3.3",
        "drupal/adminimal_theme": "^1.6",
        "drupal/allowed_formats": "^2.0",
        "drupal/antibot": "^2.0",
        "drupal/asset_injector": "^2.13",
        "drupal/backup_migrate": "^5.0",
        "drupal/better_exposed_filters": "^6.0",
        "drupal/block_class": "^2.0",
        "drupal/bootstrap_layouts": "^5.2",
        "drupal/bootstrap_paragraphs": "^2.0@beta",
        "drupal/cer": "^5",
        "drupal/chosen": "^3.0",
        "drupal/chosen_field": "^3.0",
        "drupal/chosen_lib": "^3.0",
        "drupal/ckeditor_resize": "^1.3",
        "drupal/ckeditor_specialchars": "^1.2",
        "drupal/clientside_validation": "^4.0",
        "drupal/clientside_validation_jquery": "^4.0",
        "drupal/cocoen_beforeafter": "^1.1",
        "drupal/color_field": "^3.0",
        "drupal/colorbox": "^2.0",
        "drupal/colorbox_load": "^1.2",
        "drupal/conditional_fields": "^4.0@alpha",
        "drupal/config_update": "^1.7",
        "drupal/cookies": "^1.2",
        "drupal/cookies_ga": "^1.2",
        "drupal/core-composer-scaffold": "^9.5",
        "drupal/core-project-message": "^9.5",
        "drupal/core-recommended": "^9.5",
        "drupal/ctools": "^4.0",
        "drupal/db_maintenance": "^2.0",
        "drupal/dropdown_language": "^3.1",
        "drupal/ds": "^3.15",
        "drupal/ds_extras": "^3.15",
        "drupal/editablefields": "^1.0",
        "drupal/entity_usage": "^2.0@beta",
        "drupal/features": "^3.12",
        "drupal/feeds": "^3.0@beta",
        "drupal/feeds_tamper": "^2.0@beta",
        "drupal/field_group": "^3.4",
        "drupal/field_group_bootstrap": "^3.0",
        "drupal/field_group_table": "^1.0",
        "drupal/field_permissions": "^1.2",
        "drupal/focal_point": "^1.5",
        "drupal/fontawesome": "^2.25",
        "drupal/geofield": "^1.47",
        "drupal/google_analytics": "^4.0",
        "drupal/honeypot": "^2.1",
        "drupal/image_effects": "^3.4",
        "drupal/image_url_formatter": "^1.0",
        "drupal/imagelightbox": "^2.1",
        "drupal/imagemagick": "^3.4",
        "drupal/imagick": "^1.6",
        "drupal/imce": "^3.0",
        "drupal/jquery_colorpicker": "^3.0",
        "drupal/jquery_ui": "^1.6",
        "drupal/jquery_ui_checkboxradio": "^2.0",
        "drupal/jquery_ui_slider": "^2.0",
        "drupal/jquery_ui_tabs": "^2.0",
        "drupal/jquery_ui_tooltip": "*",
        "drupal/jquery_ui_touch_punch": "^1.1",
        "drupal/krypt": "^1.0",
        "drupal/leaflet": "^10.0",
        "drupal/leaflet_geojson": "^1.6",
        "drupal/leaflet_layers": "^1.1",
        "drupal/leaflet_more_maps": "^2.1",
        "drupal/leaflet_views": "^10.0",
        "drupal/magnific_popup": "^1.5",
        "drupal/mailchimp": "^2.0",
        "drupal/mailsystem": "^4.4",
        "drupal/masonry": "^1.2",
        "drupal/masonry_views":

<details>
<summary>英文:</summary>

I have transfered locally (on a Wampserver with PHP 8.1.13 on Windows 10) a backup version of my existing Drupal 9 website. The files are on a subfolder C:/wamp64/www/BDV-dev. I have created a database (&quot;bdv_dev&quot;) and I have edited settings.php to link it :

$databases['default']['default'] = array (
'database' => 'bdv_dev',
'username' => 'root',
'password' => '',
'prefix' => '',
'host' => 'localhost',
'port' => '3306',
'driver' => 'mysql',
'collation' => 'utf8mb4_general_ci',
'init_commands' => [
'isolation_level' => 'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED',
],
);


When connecting to my website locally (virtual-host correctly configured on Wamp), it asked my to run the install process which was successfull.
Then I tried to import my existing database backup (file &quot;dev.sql&quot; in my subfolder project) with the command &quot;drush sql-cli \&lt; dev.sql&quot; but I have the following error message :
\[preflight\] Package &quot;drupal/core&quot; is not installed
It happens with all drush commands (status, cr, etc) and I can&#39;t find anything about this particular error message...
I have updated all modules / extensions with &quot;composer update -W&quot;.
Here is my composer.json file :

{
"name": "drupal/recommended-project",
"description": "Project template for Drupal projects with a relocated document root",
"type": "project",
"license": "GPL-2.0-or-later",
"homepage": "https://www.drupal.org/project/drupal",
"support": {
"docs": "https://www.drupal.org/docs/user_guide/en/index.html",
"chat": "https://www.drupal.org/node/314178"
},
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
],
"require": {
"commerceguys/addressing": "^1.4",
"composer/installers": "^2.2",
"cweagans/composer-patches": "^1.7",
"doctrine/collections": "^1.2",
"drupal/address": "^1.11",
"drupal/address_autocomplete": "^1.0@beta",
"drupal/admin_toolbar": "^3.3",
"drupal/adminimal_theme": "^1.6",
"drupal/allowed_formats": "^2.0",
"drupal/antibot": "^2.0",
"drupal/asset_injector": "^2.13",
"drupal/backup_migrate": "^5.0",
"drupal/better_exposed_filters": "^6.0",
"drupal/block_class": "^2.0",
"drupal/bootstrap_layouts": "^5.2",
"drupal/bootstrap_paragraphs": "^2.0@beta",
"drupal/cer": "^5",
"drupal/chosen": "^3.0",
"drupal/chosen_field": "^3.0",
"drupal/chosen_lib": "^3.0",
"drupal/ckeditor_resize": "^1.3",
"drupal/ckeditor_specialchars": "^1.2",
"drupal/clientside_validation": "^4.0",
"drupal/clientside_validation_jquery": "^4.0",
"drupal/cocoen_beforeafter": "^1.1",
"drupal/color_field": "^3.0",
"drupal/colorbox": "^2.0",
"drupal/colorbox_load": "^1.2",
"drupal/conditional_fields": "^4.0@alpha",
"drupal/config_update": "^1.7",
"drupal/cookies": "^1.2",
"drupal/cookies_ga": "^1.2",
"drupal/core-composer-scaffold": "^9.5",
"drupal/core-project-message": "^9.5",
"drupal/core-recommended": "^9.5",
"drupal/ctools": "^4.0",
"drupal/db_maintenance": "^2.0",
"drupal/dropdown_language": "^3.1",
"drupal/ds": "^3.15",
"drupal/ds_extras": "^3.15",
"drupal/editablefields": "^1.0",
"drupal/entity_usage": "^2.0@beta",
"drupal/features": "^3.12",
"drupal/feeds": "^3.0@beta",
"drupal/feeds_tamper": "^2.0@beta",
"drupal/field_group": "^3.4",
"drupal/field_group_bootstrap": "^3.0",
"drupal/field_group_table": "^1.0",
"drupal/field_permissions": "^1.2",
"drupal/focal_point": "^1.5",
"drupal/fontawesome": "^2.25",
"drupal/geofield": "^1.47",
"drupal/google_analytics": "^4.0",
"drupal/honeypot": "^2.1",
"drupal/image_effects": "^3.4",
"drupal/image_url_formatter": "^1.0",
"drupal/imagelightbox": "^2.1",
"drupal/imagemagick": "^3.4",
"drupal/imagick": "^1.6",
"drupal/imce": "^3.0",
"drupal/jquery_colorpicker": "^3.0",
"drupal/jquery_ui": "^1.6",
"drupal/jquery_ui_checkboxradio": "^2.0",
"drupal/jquery_ui_slider": "^2.0",
"drupal/jquery_ui_tabs": "^2.0",
"drupal/jquery_ui_tooltip": "",
"drupal/jquery_ui_touch_punch": "^1.1",
"drupal/krypt": "^1.0",
"drupal/leaflet": "^10.0",
"drupal/leaflet_geojson": "^1.6",
"drupal/leaflet_layers": "^1.1",
"drupal/leaflet_more_maps": "^2.1",
"drupal/leaflet_views": "^10.0",
"drupal/magnific_popup": "^1.5",
"drupal/mailchimp": "^2.0",
"drupal/mailsystem": "^4.4",
"drupal/masonry": "^1.2",
"drupal/masonry_views": "^1.1",
"drupal/mediteran": "^1.29",
"drupal/menu_block": "^1.10",
"drupal/metatag": "^1.22",
"drupal/metatag_dc": "^1.22",
"drupal/metatag_facebook": "^1.22",
"drupal/metatag_google_cse": "^1.22",
"drupal/metatag_open_graph": "^1.22",
"drupal/metatag_pinterest": "^1.22",
"drupal/metatag_twitter_cards": "^1.22",
"drupal/metatag_verification": "^1.22",
"drupal/metatag_views": "^1.22",
"drupal/ng_lightbox": "^2.0@beta",
"drupal/node_export": "^1.0@alpha",
"drupal/paragraphs": "^1.15",
"drupal/paragraphs_sets": "^2.8",
"drupal/pathauto": "^1.11",
"drupal/pcr": "^1.4",
"drupal/phoney": "^1.0",
"drupal/phpmailer_smtp": "^2.1",
"drupal/quick_node_clone": "^1.15",
"drupal/rabbit_hole": "^1.0@beta",
"drupal/redirect": "^1.8",
"drupal/redirect_404": "^1.8",
"drupal/rh_node": "^1.0@beta",
"drupal/schema_metatag": "^2.4",
"drupal/selective_better_exposed_filters": "^3.0@beta",
"drupal/shariff": "^1.7",
"drupal/simple_popup_views": "^1.2",
"drupal/svg_image": "^1.16",
"drupal/svg_image_responsive": "^1.16",
"drupal/svg_pan_zoom": "^1.0@beta",
"drupal/taxonomy_bulk_actions": "^1.0",
"drupal/token": "^1.11",
"drupal/tooltip": "
",
"drupal/tooltip_ckeditor": "^4.0",
"drupal/transliterate_filenames": "^2.0",
"drupal/unmanaged_files": "^1.0",
"drupal/upgrade_status": "^3.18",
"drupal/vbo_export": "^4.1",
"drupal/views_bootstrap": "^5.4",
"drupal/views_conditional": "^1.5",
"drupal/views_contextual_filters_or": "^1.4",
"drupal/views_data_export": "^1.3",
"drupal/views_delimited_list": "^2.0@alpha",
"drupal/views_entity_form_field": "^1.0@beta",
"drupal/views_exposed_filter_blocks": "^1.1",
"drupal/views_geojson": "^1.2",
"drupal/views_infinite_scroll": "^2.0",
"drupal/views_merge_rows": "^2.3",
"drupal/viewsreference": "^2.0@beta",
"drupal/webform": "^6.1",
"drupal/webform_attachment": "^6.1",
"drupal/webform_bootstrap": "^6.1",
"drupal/webform_clientside_validation": "^6.1",
"drupal/webform_icheck": "^6.1",
"drupal/webform_jqueryui_buttons": "^6.1",
"drupal/webform_location_geocomplete": "^6.1",
"drupal/webform_options_custom": "^6.1",
"drupal/webform_options_limit": "^6.1",
"drupal/webform_postcodeapi": "^1.5",
"drupal/webform_submission_export_import": "^6.1",
"drupal/webform_submission_log": "^6.1",
"drupal/webform_ui": "^6.1",
"drupal/webform_views": "^5.0",
"drupal/xmlsitemap": "^1.4",
"drupal/xmlsitemap_custom": "^1.4",
"drupal/xmlsitemap_engines": "^1.4",
"drupal/zurb_twentytwenty": "^2.0",
"drush/drush": "^11.6",
"league/csv": "^9.8",
"phayes/geophp": "^1.2",
"phpmailer/phpmailer": "^6.7",
"roave/better-reflection": "^6.5"
},
"conflict": {
"drupal/drupal": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"allow-plugins": {
"composer/installers": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true,
"drupal/core-composer-scaffold": true,
"drupal/core-project-message": true,
"cweagans/composer-patches": true
},
"sort-packages": true,
"process-timeout":0
},
"extra": {
"drupal-scaffold": {
"locations": {
"web-root": "web/"
}
},
"installer-paths": {
"web/core": ["type:drupal-core"],
"web/libraries/{$name}": ["type:drupal-library"],
"web/modules/contrib/{$name}": ["type:drupal-module"],
"web/profiles/contrib/{$name}": ["type:drupal-profile"],
"web/themes/contrib/{$name}": ["type:drupal-theme"],
"drush/Commands/contrib/{$name}": ["type:drupal-drush"],
"web/modules/custom/{$name}": ["type:drupal-custom-module"],
"web/profiles/custom/{$name}": ["type:drupal-custom-profile"],
"web/themes/custom/{$name}": ["type:drupal-custom-theme"]
},
"drupal-core-project-message": {
"include-keys": ["homepage", "support"],
"post-create-project-cmd-message": [
"<bg=blue;fg=white> </>",
"<bg=blue;fg=white> Congratulations, you’ve installed the Drupal codebase </>",
"<bg=blue;fg=white> from the drupal/recommended-project template! </>",
"<bg=blue;fg=white> </>",
"",
"<bg=yellow;fg=black>Next steps</>:",

            &quot;  * Install the site: https://www.drupal.org/docs/installing-drupal&quot;,
&quot;  * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html&quot;,
&quot;  * Get support: https://www.drupal.org/support&quot;,
&quot;  * Get involved with the Drupal community:&quot;,
&quot;      https://www.drupal.org/getting-involved&quot;,
&quot;  * Remove the plugin that prints this message:&quot;,
&quot;      composer remove drupal/core-project-message&quot;
]
},
&quot;patches&quot;: {
}
},
&quot;require-dev&quot;: {
&quot;drupal/core-dev&quot;: &quot;^9.5&quot;
}

}


I also tried &quot;drush status&quot; locally on Xampp and I am experiencing the same error message.  
I really can&#39;t see what is happening here...
</details>
# 答案1
**得分**: 1
我已找到一个解决方案(至少是临时解决方案):我刚刚将我的drush项目文件夹($PROJECT/vendor/drush/drush)添加到我的Windows $PATH中,重新启动了我的终端Cmder,现在像“drush status”这样的命令不再显示错误消息!
<details>
<summary>英文:</summary>
It seems I have found a solution (at least temporarily): I have just added my drush project folder ($PROJECT/vendor/drush/drush) to my Windows $PATH, re-launched my terminal Cmder and now commands like &quot;drush status&quot; no longer throws error messages!
</details>

huangapple
  • 本文由 发表于 2023年6月30日 04:57:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/76584573.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定