PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, February 18, 2022

[FIXED] Path "/modules/custom" is invalid while runing drupal generate:module

 February 18, 2022     composer-php, drupal-8, drupal-console     No comments   

Issue

I'm trying to install a Drupal's plugin while using drupal-console. I run it in /var/www/drupalvm/drupal/web$

I checked my drupal.composer.json file and everything is correct i believe

"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"]
}

What i run:

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"

Thank you


Solution

The problem is you're providing an absolute --module-path as /modules/custom which doesn't exist on your system.

You need to provide a relative path or existing absolute path instead.

The solution is to either omit the leading / or use the absolute path:

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


Answered By - Nicolai Fröhlich
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing