xeno_hero icon indicating copy to clipboard operation
xeno_hero copied to clipboard

Installing with Composer

Open tkcent opened this issue 6 years ago • 6 comments

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

tkcent avatar Oct 16 '18 17:10 tkcent

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!

jsibley2 avatar Aug 03 '21 19:08 jsibley2

@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.

albertski avatar Aug 03 '21 19:08 albertski

Sorry, that was it. Thanks!

jsibley2 avatar Aug 03 '21 19:08 jsibley2

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.

acroundtree avatar Jan 11 '22 21:01 acroundtree

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 avatar Sep 16 '23 20:09 albinsopaj

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.

albinsopaj avatar Sep 16 '23 20:09 albinsopaj