Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing with Composer #20

Open
tkcent opened this issue Oct 16, 2018 · 6 comments
Open

Installing with Composer #20

tkcent opened this issue Oct 16, 2018 · 6 comments

Comments

@tkcent
Copy link

tkcent commented Oct 16, 2018

Just thought I would leave a note here in case anyone was wanting to install with Composer. Not sure if this is the official way to do it, but it worked for me.

  1. Update your project composer.json file with the xeno_hero repository:
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        {
            "type": "git",
            "url": "https://github.com/xenomedia/xeno_hero.git"
        }
    ],
  1. Update your project composer.json file so it knows where to install the modules with the type of "drupal-custom-module". This is what is configured in the xeno_hero composer.json file. I put it in contrib with other modules but you could also put it in a custom directory.
        "installer-paths": {
            "web/modules/contrib/{$name}": ["type:drupal-module","type:drupal-custom-module"],
        },
  1. Update Composer so it knows about the new repository.
composer update
  1. Add the module using Composer
composer require xenomedia/xeno_hero
@jsibley2
Copy link

jsibley2 commented Aug 3, 2021

After installing the module this way, how does one uninstall it in Drupal 8.

Composer remove doesn't give an error, but after that drush cr gives me this:

Fatal error: Uncaught AssertionError: The file specified by the given app root, relative path and file name (/app/docroot/modules/custom/xeno_hero/xeno_hero.info.yml) do not exist. in /app/docroot/core/lib/Drupal/Core/Extension/Extension.php:67
Stack trace:
#0 /app/docroot/core/lib/Drupal/Core/Extension/Extension.php(67): assert(false, 'The file specif...')
#1 /app/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(114): Drupal\Core\Extension\Extension->__construct('/app/docroot', 'module', 'modules/custom/...', 'xeno_hero.modul...')
#2 /app/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php(259): Drupal\Core\Extension\ModuleHandler->__construct('/app/docroot', Array, Object(Drupal\Core\Cache\ChainedFastBackend))
#3 /app/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array, 'module_handler')
#4 /app/docroot/core/lib/Drupal/Core/DrupalKernel.php(586): Drupal\Component\DependencyInjection\Container->get('module_ha in /app/docroot/core/lib/Drupal/Core/Extension/Extension.php on line 67
 [warning] Drush command terminated abnormally.

Any thoughts? Thanks!

@albertski
Copy link
Collaborator

@jsibley2 It looks like the module wan't uninstalled prior to the removal. You may want to add it back in, uninstall it, and then remove it.

@jsibley2
Copy link

jsibley2 commented Aug 3, 2021

Sorry, that was it. Thanks!

@acroundtree
Copy link

I'm trying to use the commands above to install xeno hero using composer, however when I do there's nothing to install or update. Nothing comes from the repository despite the composer.json file updating.

@albinsopaj
Copy link

I'm getting this error after doing the following procedure: uninstalled Simple OAuth module -> cleared the cache via admin pannel -> run the command composer remove drupal/simple_oauth.

Would appreciate any help. Thanks.

The website encountered an unexpected error. Please try again later.
AssertionError: The file specified by the given app root, relative path and file name (/usr/www/users/lsmrk/modules/contrib/consumers/consumers.info.yml) do not exist. in assert() (line 73 of core/lib/Drupal/Core/Extension/Extension.php).
assert() (Line: 73)
Drupal\Core\Extension\Extension->__construct() (Line: 114)
Drupal\Core\Extension\ModuleHandler->__construct() (Line: 259)
Drupal\Component\DependencyInjection\Container->createService() (Line: 177)
Drupal\Component\DependencyInjection\Container->get() (Line: 588)
Drupal\Core\DrupalKernel->preHandle() (Line: 46)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)

@albinsopaj
Copy link

I'm getting this error after doing the following procedure: uninstalled Simple OAuth module -> cleared the cache via admin pannel -> run the command composer remove drupal/simple_oauth.

Would appreciate any help. Thanks.

The website encountered an unexpected error. Please try again later.
AssertionError: The file specified by the given app root, relative path and file name (/usr/www/users/lsmrk/modules/contrib/consumers/consumers.info.yml) do not exist. in assert() (line 73 of core/lib/Drupal/Core/Extension/Extension.php).
assert() (Line: 73)
Drupal\Core\Extension\Extension->__construct() (Line: 114)
Drupal\Core\Extension\ModuleHandler->__construct() (Line: 259)
Drupal\Component\DependencyInjection\Container->createService() (Line: 177)
Drupal\Component\DependencyInjection\Container->get() (Line: 588)
Drupal\Core\DrupalKernel->preHandle() (Line: 46)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Solved it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants