【问题标题】:How to fix error "drush - command not found" for drupal8?如何修复 drupal8 的错误“drush - command not found”?
【发布时间】:2020-01-09 02:13:39
【问题描述】:

我通过 composer 为 drupal 8 安装了 drush8。我已将 .bashsrc 文件更新为 export PATH="$HOME/.composer/vendor/bin:$PATH"。但是当我尝试执行 drush 命令时,终端显示“找不到命令”

【问题讨论】:

  • 您是否再次获取了您的 bashrc,以便将更改应用于您当前的终端会话?
  • Drupal 8.4+ 需要 Drush 9,请参阅 docs.drush.org/en/master/install/#drupal-compatibility
  • 还有Drush only supports one install method. It requires that your Drupal site be built with Composer and Drush be listed as a dependency.
  • 你必须运行命令source ~/.bashrc,然后bashrc文件的变化才会反映。
  • @leymannx 我安装了 drush 9,但它显示兼容性错误,所以我将其更改为版本 8

标签: drush


【解决方案1】:

试试这个,如果 Drush 已经安装,使用 $which drush 检查这将显示当前的 drush 路径类似于 ~/vendor/drush/drush

如果您没有安装 drush,您可以使用添加 $ composer global 需要 drush/drush

添加 .bashrc 文件的路径。 PATH=$PATH:$HOME/bin:/home/currentusername/vendor/drush/drush

导出路径

保存更改并退出终端并重新登录以从任何路径验证您的 drush 作品。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-09-05
    • 2020-09-26
    • 2019-12-09
    • 2021-05-15
    • 2019-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多