【问题标题】:Path "/modules/custom" is invalid while runing drupal generate:module运行 drupal generate:module 时路径“/modules/custom”无效
【发布时间】:2019-08-27 08:59:29
【问题描述】:

我正在尝试在使用 drupal-console 时安装 Drupal 的插件。 我在 /var/www/drupalvm/drupal/web$ 中运行它

我检查了我的 drupal.composer.json 文件,我相信一切都是正确的

"installer-paths": {
    "web/core": ["type:drupal-core"],
    "web/modules/contrib/{$name}": ["type:drupal-module"],
    "web/profiles/contrib/{$name}": ["type:drupal-profile"],
    "web/themes/contrib/{$name}": ["type:drupal-theme"],
    "drush/contrib/{$name}": ["type:drupal-drush"]
}

我运行的是什么:

drupal generate:module   --module="My checkout flow"
--machine-name="my_checkout_flow"
--module-path="/modules/custom"
--description="My checkout flow"
--core="8.x"
--package="LSB"
--composer
--dependencies="commerce:commerce_checkout"

谢谢

【问题讨论】:

  • 请在问题中添加确切的异常/错误消息。
  • 对不起,我没看到我忘了放,这里我得到了什么:在 Validator.php 第 174 行:路径“/modules/custom”无效。您需要提供有效路径。

标签: composer-php drupal-8 drupal-console


【解决方案1】:

问题是您提供了一个绝对的--module-path 作为/modules/custom,它在您的系统上不存在。

您需要提供相对路径或现有的绝对路径。

解决方案是要么省略前导/,要么使用绝对路径:

--module-path='modules/custom'
# ... or ...
--module-path="$(realpath modules/custom)"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-12-17
    • 2020-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多