Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By holljac on
What directory should a new module get installed into when using composer? The reason I ask is because I have my site setup at home on wamp and then the live site is hosted. When I install the metatag, token and token or modules on my home computer, they intall in the modules/contrib folder. When I install it into the live site, they get installed into the modules folder. Which is the correct one and why is this discrepency happening?
Comments
the /modules/contrib folder
the /modules/contrib folder is correct, although they will also be picked up if they are in the /modules folder. But, it's not normal that they would not be installed to the same folder - are you using different composer.json files for the environment? If they are a copy of each other, they will install to the same directory.
Could I just copy my local
Could I just copy my local composer.json to the hosted one?
Installer path is listed as
Installer path is listed as
"modules/contrib/{$name}": [
"type:drupal-module"
],
in both local and remote.
In composer.json there should
In composer.json there should be an installer path section that looks like this:
You might want to check (compare) the two composer.jsons (hosted and local) and make sure the contrib modules are in the contrib path.