i have installed the related modules with composer, composer manager lists the in the report but when i want to install the module on D8.0.1 I only get "Address requires the commerceguys/addressing library. "

what can I do?

[00:13:41] server451-han:~/drupal.mediaweb.at/modules/address > /usr/local/php5.5/bin/php ../../../bin/composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files

[00:15:31] server451-han:~/drupal.mediaweb.at > /usr/local/php5.5/bin/php ../bin/composer.phar update-drupal
[InvalidArgumentException]
Command "update-drupal" is not defined.

Status of Packages Managed by Composer Paket Installed Version Required Version
commerceguys/addressing
Addressing library powered by Google's address data.
dev-master#7bb474fc0888210fad62d203fc8a9909775ec12b dev-master
Required by: address
commerceguys/intl
Internationalization library powered by CLDR data.
dev-master#d975da224440180cfb97c9db135b53ec3ed52079 dev-master
Required by: address
commerceguys/zone
Zone management library.
dev-master#1a690b7366a58cf3778b8ca440813d89a56204d4 dev-master
Required by: address

Comments

MartinMa created an issue. See original summary.

bojanz’s picture

Status: Active » Fixed

Composer can't be run inside each module separately. Please read https://bojanz.wordpress.com/2015/09/18/d8-composer-definitive-intro/ or follow the module README.

martinma’s picture

Thanks for your info

On my second installation I installed composer manager with the D8 interface. I think i also tried to install the modules via composer call in the modules folder. Maybe composer manger UI doesnt make a difference between local installed libraries an with drupal-update installed libraries, because the libraries were listed in the reoport of composer manager but i also couldnt install address module ...

So i removed the librarieres with call of composer in the modules folder. the librariries were removed from the composer.json file. I uploaded the origional file an made the procedure as described in your article, but it also didnt work ... composer is not really user friendly ...

i got a message about jcalderonzumba/mink-phantomjs-driver, but i can't remove jcalderonzumba/mink-phantomjs-driver via composer ...

a solution for common people would be great, were i only install composer manager module and all works fine without hacking in the console ...

[11:06:51] server451-han:~/drupal.mediaweb.at/modules/address > vi composer.json
[11:15:27] server451-han:~/drupal.mediaweb.at/modules/address > cd ../..
[11:15:45] server451-han:~/drupal.mediaweb.at > /usr/local/php5.5/bin/php modules/composer_manager/scripts/init.php
Composer Manager has been successfully initialized.
[11:16:05] server451-han:~/drupal.mediaweb.at > /usr/local/php5.5/bin/php ../bin/composer.phar drupal-update
> Drupal\composer_manager\Composer\Command::update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing commerceguys/intl (dev-master d975da2)
Loading from cache

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing commerceguys/enum (v1.0)
Loading from cache

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing commerceguys/addressing (dev-master 7bb474f)
Loading from cache

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing commerceguys/zone (dev-master 1a690b7)
Loading from cache

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Updating jcalderonzumba/mink-phantomjs-driver dev-master (10d7c48 => 5bf53fa)

[RuntimeException]
The .git directory is missing from /medjxcwh/drupal.mediaweb.at/vendor/jcalderonzumba/mink-phantomjs-driver, see https://getc
omposer.org/commit-deps for more information

martinma’s picture

Now I dont know, if I could try out the second method, because with my first trial there has something been installed and i dont know how / if i get the system back in its orginal status ...

martinma’s picture

A look to composer.json in the root directory shows, that nothing has changed. (mod of file is -rw-r--r--).

martinma’s picture

In Your article "The definitive introduction to D8 and Composer" its not clear if following the instructions for "Sugar-free Composer" were to put the code. At the end of the file or after the first statement, or anywhere ...

martinma’s picture

Hm, hm ...

I couldnt apply second method "Sugar-free Composer" after the first trial:

[11:59:34] server451-han:~/drupal.mediaweb.at > /usr/local/php5.5/bin/php ../bin/composer.phar require drupal/commerce 8.1.@dev
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package drupal/commerce could not be found in any version, there may be a typo in the package name.
Problem 2
- drupal/address 8.1.0-beta1 requires drupal/field 8.* -> satisfiable by drupal/core[8.0.0, 8.0.0-beta12, 8.0.0-beta13, 8.0.0-beta14, 8.0.0-beta15, 8.0.0-beta16, 8.0.0-rc1, 8.0.0-rc2, 8.0.0-rc3, 8.0.0-rc4, 8.0.1, 8.0.x-dev].
..... and so on ....
- Installation request for drupal/drupal No version set (parsed as 1.0.0) -> satisfiable by drupal/drupal[No version set (parsed as 1.0.0)].
- Installation request for drupal/address 8.1.*@dev -> satisfiable by drupal/address[8.1.0-beta1, 8.1.0-beta2, 8.1.x-dev].

Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see for more details.

Read for further common problems.

Installation failed, reverting ./composer.json to its original content.

barrypoore’s picture

I have been struggling with this now for 2 days and cannot get past trying to enable the address module as I just get the error message "Address requires the commerceguys/addressing library."

Documentation seems a bit unclear how to enable this, and even the documentation page returns a 404 error. I have followed the README.me file in the address module but still just getting the same error.

My Steps:
1.) Download Address module, unzip and add to /modules
2.) Enable in the D8 extend page, message returned "Address requires the commerceguys/addressing library"

I then download and unzip the library from the git page https://github.com/commerceguys/addressing, this unzips a directory called addressing-master

Now I'm not sure where I should put this folder. do I make a '/libraries' folder and put it in there? Do I put it in '/vendor'?
I tried both the above and re attempted to enable the address module but still got the same message returned "Address requires the commerceguys/addressing library."

So I have installed composer manager, run init.php from the command line, all good, went to enable the address module and still got that same message.

I then try cd into the address module directory in terminal then run $ composer install, still got that same message.
Now I try adding "commerceguys/addressing": "dev-master" to the require part of the composer.json file that's in the root directory then running composer drupal-update from the root of my project and I get this:

> Drupal\composer_manager\Composer\Command::update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Updating jcalderonzumba/mink-phantomjs-driver dev-master (10d7c48 => 5bf53fa)

[RuntimeException]
The .git directory is missing from /Users/barrypoore/mampsites/d8/vendor/jcalderonzumba/mink-phantomjs-driver, see https://getcomposer.org/commit-deps for m
ore information

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--] [
]...

I have googled as much as I can to try to resolve this but 2 days now and I'm still stuck with no address module enabled, can somebody please advise?

Thanks you in advance.

barrypoore’s picture

From what I can understand, I can either add the 'commerceguys/addressing' library to the require of the composer.json file in the drupal root then run 'composer drupal-update' from the project root.

Or I can cd in terminal to the module directory i.e. '/modules/contrib/address' then use composer install

I thought that either one of those methods should add the library and make it so I can enable the address module?

barrypoore’s picture

Ok it looks like I have installed the required libraries how ever the error message "Address requires the commerceguys/addressing library." is still returned when I attempt to enable the Address module.

I can now see the library listed in composer manager under reports:
Status of Packages Managed by Composer

Package
commerceguys/addressing
Addressing library powered by Google's address data.

Installed Version
dev-master#7bb474fc0888210fad62d203fc8a9909775ec12b

Required Version
dev-master
Required by: address

bojanz’s picture

Status: Fixed » Active

I'm sorry you're having a tough time. The road of an early adopter is often bumpy.

[RuntimeException]
The .git directory is missing from /Users/barrypoore/mampsites/d8/vendor/jcalderonzumba/mink-phantomjs-driver, see https://getcomposer.org/commit-deps for m
ore information

This is a Drupal core bug fixed in the latest -dev release. You'll need to update Drupal (replacing the core and vendor directories), after which the composer_manager instructions will work.

For any composer_manager questions you can refer to its documentation https://www.drupal.org/node/2405811.

From what I can understand, I can either add the 'commerceguys/addressing' library to the require of the composer.json file in the drupal root then run 'composer drupal-update' from the project root.

If you're using composer drupal-update then you don't need to edit composer.json at all, it will do that for you.

Or I can cd in terminal to the module directory i.e. '/modules/contrib/address' then use composer install
I then download and unzip the library from the git page https://github.com/commerceguys/addressing, this unzips a directory called addressing-master

These two approaches can never work. I've covered this in the blog post I mentioned in #1.

barrypoore’s picture

Hi Bojanz,
Firstly a massive thank you for your quick response, I understand now that running composer drupal-update from within the root directory is the right thing to do, I have done that and can see the entry for the address module has been written into the composer.json in the project root.
I can also see the packages in the Drupal UI config as mentioned above so that is great.

Shame now my site has blown up (The website encountered an unexpected error. Please try again later.), it is Drupal 8.0.1 running on a local Mamp stack on mac and the php logs display a message "Uncaught PHP Exception Exception: "The configuration directory type 'sync' does not exist" at..../core/includes/bootstrap.inc line 154"

I imagine this is not anything to do with the address module or the composer manager module, the only two modules added to this install so far so I look elsewhere for a solution for this and will carry out some further testing.

Just one more thing though, the error "The .git directory is missing from /Users/barrypoore/mampsites/d8/vendor/jcalderonzumba/mink-phantomjs-driver" I first mentioned is happening on 8.0.1

bojanz’s picture

@barrypoore
In sites/default/files you are supposed to have a config_$hash folder with a sync subfolder. That's usually created by the installer.

barrypoore’s picture

@bojanz, ok yes I can see that is missing, I have just run a new install and can now see this folder there so that's ok now.

I have just installed a brand new drupal8 on my local, installed, enabled and added the composer manager to /modules/contrib, ran the instructions from the README.txt and composer has serialized fine and is installed no problem.

I have now added the address module to the same /modules/contrib folder, ran 'composer drupal-update' in terminal from the project root.

Terminal looked good:

barrys-mac-mini:d8test barrypoore$ composer drupal-update
> Drupal\composer_manager\Composer\Command::update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing commerceguys/intl (dev-master d975da2)
Loading from cache

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing commerceguys/enum (v1.0)
Loading from cache

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing commerceguys/addressing (dev-master 7bb474f)
Loading from cache

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing commerceguys/zone (dev-master 1a690b7)
Loading from cache

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Updating jcalderonzumba/mink-phantomjs-driver dev-master (10d7c48 => 5bf53fa)

I have looked at the composer.json file in the project root and can see it has been updatd by the process:

"replace": {
"drupal/core": "~8.0",
"drupal/address": "8.*"
},

So everything should now be good but whenever I attempt to enable the Address module in the extend page I still get the error message:

"Address requires the commerceguys/addressing library."

I'm pretty sure I am doing everything right now, any ideas what this could be?

Maybe Drupal 8 is still a bit too new and buggy for production?

bojanz’s picture

I've never seen the library installed but not found by the autoloader. I'll try to reproduce on a fresh install.

Maybe Drupal 8 is still a bit too new and buggy for production?

Every major new Drupal release is initially only stable if you need precisely 0 contrib modules :)

barrypoore’s picture

That's great thanks very much, I sure can't figure it out.

Good point btw!!!

I hope you too are able to reproduce the error.

barrypoore’s picture

BTW I can see the commerceguys folder in vendor and it has it's sub folders inside so it would appear composer did it's job.

stizzi’s picture

Deleted; unrelated to Address issue (Sorry - Drupal novice)

nikathone’s picture

I can confirm that I am also having a tough time to either install the address or commerce module and their dependencies on a fresh d8.0.1. But I swear that this was possible few days ago coz I have a dev site running with the address module installed.

To reproduce the problem #1 mentioned in #18:

  1. do drush dl drupal-8.0.1 on your desired location then
  2. cd drupal-8.0.1 | drush dl composer_manager
  3. php modules/composer_manager/scripts/init.php
  4. once the initialization is successful run composer drupal-update
  5. at this point you might get the #12 problem( jcalderonzumba/mink-phantomjs-driver) but to get around it just do rm -rf vendor/oljcalderonzumba/mink-phantomjs-driver | composer drupal-update
  6. After the previous cmd everything should be fine but once you do drush dl address followed by composer drupal-update that where I get the #18 composer error.

I hope someone will be able to help us get pass this problem but in the meantime you can ignore composer update module then do mkdir drupal-composer | cd drupal-composer and then upload the attached composer.json file and adapt/change it at your like then run composer install after this you should have drupal installed in web dir with commerce modules and its dependencies and all the php libraries needed. P.S: Drupal didn't let me upload a .json file so here is the snippet

{
  "name": "mycompany/myproject",
  "description": "My project definition",
  "type": "project",
  "repositories": [
    {
      "type": "composer",
      "url": "https://packagist.drupal-composer.org"
    }
  ],
  "require": {
    "composer/installers": "^1.0.20",
    "drupal/core": "8.0.0",
    "drupal/commerce": "dev-8.x-2.x"
  },
  "minimum-stability": "dev",
  "prefer-stable": true,
  "extra": {
    "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"]
    }
  }
}


Credit goes to our sys admin who helped me.

bojanz’s picture

Let's not confuse the issue further. The Commerce fails are unrelated to any Address fails, and have their own issue now #2638096: Composer installation sometimes fails when resolving dependent modules.

nikathone’s picture

Thanks @bojanz for clarification but I am getting the issue mentioned in the commerce module even if I try to install the address module only. Will try to get drupal with git then see if I be able at least to install the address module with its dependencies. Keep the good work...

nikathone’s picture

bojanz’s picture

@nikathone
The bug would appear when trying to composer require any Drupal module directly.
That's why I still insist on the Composer Manager workflow despite it being longer.
Gives people less pain while we fix the newly discovered bugs.

xano’s picture

We're trying to make https://www.drupal.org/node/2627292 the main documentation about installing modules' Composer dependencies. I'd like to invite you to use your experience to help make these instructions clear for everyone.

lostcarpark’s picture

I seem to be having a similar problem.

I untarred the Address module, and ran "composer drupal-update".

It created the following directories:

vendor/commerceguys/addressing
vendor/commerceguys/enum
vendor/commerceguys/intl
vendor/commerceguys/zone

under the Drupal 8 root directory. Everything looks like it should be in its proper place.

However, when I try to install the Address module in my Drupal site, I get the following error:

"Address requires the commerceguys/addressing library."

Is there something missing I need to do to tell Drupal it's present?

Thanks,

James

barrypoore’s picture

That's exactly what I'm encountering lostcarpark, I've had to resort to another method to acheive my objectives as this doesn't look like it's getting fixed any time soon, now the other method also breaks, so much love for Drupal 8 already :(

bojanz’s picture

I've been unable to reproduce the problem.
I started by extracting a Drupal 8.0.1 archive. Then:

drush dl composer_manager
drush dl address
rm -rf vendor/jcalderonzumba/mink-phantomjs-driver/
php modules/composer_manager/scripts/init.php
composer drupal update
drush si
drush en -y address

We need to figure out what makes your installs different, barrypoore and lostcarpark.
Are you getting the fail locally or on a server?

What happens if you run Drupal's rebuild.php, does that fix it?
My theory is that your container is getting cashed in apcu and that cache isn't cleared when composer drupal update runs.

barrypoore’s picture

I'm getting my issue on a local Mamp server (Mamp Pro), I have been doing mine all manually. I'll try the proceedure using drush on a brand new D8.0.1 exactly as you have done (as mentioned above), I'll let you know the result once I've done it.

Thanks again.

bojanz’s picture

Drush shouldn't be a factor. Make sure you try rebuild.php

barrypoore’s picture

Ok so I have just run /rebuild.php and attempted to enable the address module again but no cigar, still getting the same error message:

"Address requires the commerceguys/addressing library."

barrypoore’s picture

I just went to my config page to clear the caches and got served an error, "The website encountered an unexpected error. Please try again later."

Tracing the error through my php console I found:

Uncaught PHP Exception Symfony\Component\Routing\Exception\RouteNotFoundException: "Route "composer_manager.packages_page" does not exist." at /Users/xxxxxx/mampsites/d8/core/lib/Drupal/Core/Routing/RouteProvider.php line 191

I am not sure if this is related or not?

bojanz’s picture

That error sometimes appears when the cache isn't rebuilt. A "drush cr" (or rebuilding caches through the UI) fixes it.

Ok, so since rebuild.php didn't fix it. That means it's not APC. Can you think of any other steps you might have taken differently?
I'll try to install MAMP and try it myself.

barrypoore’s picture

Ok here's what I just did.

Created a brand new local server
Put a fresh brand new Drupal v8.0.1 on it
Added the composer manager module (Version: 8.x-1.0-rc1) to /modules/contrib
Enabled the module in the UI (extend)
In terminal cd'd to the module folder /modules/contrib/composer_manager
In there ran comand in terminal: php scripts/init.php
After that ran the terminal returned "Composer Manager has been successfully initialized."
Ran /rebuild.php in the browser window
Added the Address module (Version: 8.x-1.0-beta2) to /modules/contrib
In terminal cd'd to the project root and ran "composer drupal-update"
I watched all the dependancies install one by one, here's an example of the first one:

> Drupal\composer_manager\Composer\Command::update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing composer/installers (v1.0.21)
- Installing composer/installers (v1.0.22)
Loading from cache

After they all ran I could see the commerceguys folder in /vendor
I then ran rebuild.php from the browser and attempted to enable the address module from the UI in the extend page but still got that same error message:

"Address requires the commerceguys/addressing library."

One thing I have noticed though is in the extend pagethe dropdown for the address module does say "Requires: Field"

I'm not entirely sure what that is referring to, I have looked on the address module page and there's no mention of dependancies on there?

Those were my exact steps, thanks again for your assistance with trying to get this working :)

shawnmatthews’s picture

Following the same methodology as Barrypoore, Lostcarpark, etc. I am running this locally with the exact same versions as Barry on MAMP Pro and running into the same issue per post #33. I will report back on any additional findings, but wanted to reach out to state this isn't an isolated incident.

nikathone’s picture

For #33 instead of

In terminal cd'd to the module folder /modules/contrib/composer_manager
In there ran comand in terminal: php scripts/init.php

can you

cd <drupal-root-folder>
php modules/contrib/composer_manager/scripts/init.php



as per composer manager documentation under installation and see if it will resolve your problem.

shawnmatthews’s picture

Good evening Nikathone,

I attempted to run the command from the root directory of the project per your recommendation. It didn't yield any change in results. Thanks for the help though!

lostcarpark’s picture

Hi,

I'm running remotely on a Centos 6 server. I don't have Drush installed.

Just to confirm, I ran the init.php and the composer commands from the Drupal root directory.

I tried refresh.php as suggested, but it hasn't made any difference.

When I first untared the module, I tried to install it before running composer. Would that make any difference.

Looking at the install file, it seems to use the "use" statement to detect the presence of the library. I will try experimenting with use statements to include this and other libraries in my own module and see if I can find anything useful. It might be 24 hours before I get a chance, though.

James

barrypoore’s picture

Lostcarpark,
"When I first untared the module, I tried to install it before running composer. Would that make any difference."

I also did that and wondered the same thing but have since retried the process correctly on a fresh install, doesn't make any difference.

I'm all out of ideas with this one, hopefully someone will crack it soon.

nikathone’s picture

So here is a simple way I got it working:

  1. download drupal 8.0.1 through git git clone --branch 8.0.1 http://git.drupal.org/project/drupal.git drupal8
  2. cd drupal8
  3. drush dl composer_manager
  4. rm -rf vendor/jcalderonzumba/mink-phantomjs-driver
  5. php modules/composer_manager/scripts/ini.php inside drupal root dir
  6. drush dl address
  7. composer drupal-update
  8. Install your drupal site. drush si (with vdd inside you vbox drush @drupal8 si standard)
  9. log in and enable the address module or drush en address

I can assure you that I did the steps above to try address and commerce modules with success. The only thing I don't currently like about composer manager is that it will not download required modules inside modules/contrib folder if you created it.

barrypoore’s picture

Actually I'm wondering if it's composer that's the problem?

I did a search for the string "Address requires the commerceguys/addressing library." in the codebase and found it in '/Users/xxx/mampsites/d8test/modules/contrib/address/address.install'

The condition looks for the class existance of '\CommerceGuys\Addressing\Repository\AddressFormatRepository' which is obviously returning false hence the error message gets served.

I'm also getting other errors with D8 which ends up displaying the following message on screen:
"The website encountered an unexpected error. Please try again later."

I have looked in my php console and it always points to the same thing
Composer\Autoload\ClassLoader->findFile() /Users/xxx/mampsites/d8test/vendor/composer/ClassLoader.php:300

So maybe classes are not getting loaded, not getting found, and hence nothing is working?

I'm clutching at straws here but does anyone think there could be something in this?

lostcarpark’s picture

I also think Composer might be the cause of the problem.

I've added the following to my development module:

    dpm(class_exists('\Composer\Autoload\ClassLoader'), "ClassLoader class");
    dpm(class_exists('\Symfony\Component\DependencyInjection\Container'), "Container class");
    dpm(class_exists('\Symfony\Component\HttpKernel\Client'), "Client class");
    dpm(class_exists('\Symfony\Component\ClassLoader\ApcClassLoader'), "ApcClassLoader class");
    dpm(class_exists('\Symfony\Component\ClassLoader\ApcUniversalClassLoader'), "ApcUniversalClassLoader class");
    dpm(class_exists('\Symfony\Component\EventDispatcher\Event'), "Event class");
    dpm(class_exists('\Symfony\Polyfill\Mbstring\Mbstring'), "Mbstring class");
    dpm(class_exists('\SebastianBergmann\Exporter\Exporter'), "Exporter class");
    dpm(class_exists('\Stack\Builder'), "Builder class");
    dpm(class_exists('\GuzzleHttp\Client'), "Client class");
    dpm(class_exists('\CommerceGuys\Zone\PostalCodeHelper'), "PostalCodeHelper class");
    dpm(class_exists('\CommerceGuys\Intl\Country\Country'), "Country class");
    dpm(class_exists('\CommerceGuys\Addressing\Model\Address'), "Address class");
    dpm(class_exists('\CommerceGuys\Addressing\Repository\AddressFormatRepository'), "AddressFormatRepository class");

Which gives the following output:

    ClassLoader class => 1
    Container class => 1
    Client class => 1
    ApcClassLoader class => 1
    ApcUniversalClassLoader class => 1
    Event class => 1
    Mbstring class => 
    Exporter class => 1
    Builder class => 1
    Client class => 1
    PostalCodeHelper class => 
    Country class => 
    Address class => 
    AddressFormatRepository class => 

Outside the CommerceGuys libraries, it seems to load everything except the Mbstring class (is this because it's defined as a final class?), but it fails to find anything from the CommerceGuys libraries. I'm not sure how the autoloader tracks where the library files are, but I suspect it's missing these libraries.

Does this help at all?

James

barrypoore’s picture

I have just followed the prodeedure from #39, nikathone

Finally the address module is now enabled.

It would appear the only difference in the process from #39 is to install the module prior to installing Druapl, gets it enabled but it's not an ideal solution.

bojanz’s picture

What do you mean by " install the module prior to installing Drupal"? Which command is that?
A module can only be installed after Drupal is installed, so I'm guessing you're thinking of a different step.

barrypoore’s picture

Actually what I meant to say was I added the module before installing Drupal
I followed the steps from #39

1.) download drupal 8.0.1 through git git clone --branch 8.0.1 http://git.drupal.org/project/drupal.git drupal8
2.) cd drupal8
3.) drush dl composer_manager
4.) rm -rf vendor/jcalderonzumba/mink-phantomjs-driver
5.) php modules/composer_manager/scripts/ini.php inside drupal root dir
6.) drush dl address
7.) composer drupal-update

Now the install begins after downloading composer_manager & address

8.) Install your drupal site. drush si (with vdd inside you vbox drush @drupal8 si standard)
9.) log in and enable the address module or drush en address

Re step 9 I used 'drush en address' and now the address module is finally installed.

barrypoore’s picture

So does the fact that the address module successfully enables if added before the drupal install shed any new light on what the issue may be?

bojanz’s picture

None whatsoever. It still points to MAMP triggering a Composer bug, where the autoloader isn't up to date, but I won't know more until I install MAMP.

How recent is your Composer install? Maybe a "composer self-update" would change things.

barrypoore’s picture

I only installed composer for the first time about a week ago and made sure it was up to date, maybe I could look at my Mamp version and see how up to date that is.

bostonid’s picture

I was having similar issues with it not being picked up by the autoloader and ran $ composer dumpautoload which resolved it. Hopefully it works for others.

samuel.mortenson’s picture

#48 Worked for me! @simetau is that dude!

lostcarpark’s picture

Yes!

Thanks a million Simetau.

After $ composer dumpautoload the output from my debug statements (in coment #41) is:

    ClassLoader class => 1
    Container class => 1
    Client class => 1
    ApcClassLoader class => 1
    ApcUniversalClassLoader class => 1
    Event class => 1
    Mbstring class => 1
    Exporter class => 1
    Builder class => 1
    Client class => 1
    PostalCodeHelper class => 1
    Country class => 1
    Address class => 1
    AddressFormatRepository class => 1

Could this step be added to the install instructions for the Address module (and other modules requiring Composer libraries), as I suspect it would save a lot of pain?

James

bojanz’s picture

Okay, that helps a lot, because it points me to a part I can debug. Thanks, simetau!

dotline’s picture

Had the same problem
What worked for me,
I deleted the vendor/jcalderonzumba directory
did a composer drupal-update in the promt
and go to admin/module Address install and it works

barrypoore’s picture

I have tried the method mentioned in #48 but I still get the dreaded "Address requires the commerceguys/addressing library."

My steps were:
1.) delete the vendor/jcalderonzumba directory
2.) cd into project root and run composer dumpautoload
3.) run composer drupal-update
4.) attempted to enable address module, failed!!!

bojanz’s picture

@barrypoore
#2 needs to come after #3 in your steps.

jimafisk’s picture

Upgrading core to the dev version like bojanz said in #11 worked for me.

drush upc drupal-8.0.x-dev
php modules/contrib/composer_manager/scripts/init.php
composer drupal-update
drush en address

fehin’s picture

jimafisk's step in #55 worked for me. Thanks!

joknjokn’s picture

#48 worked for me.

bojanz’s picture

I've added the "composer dump-autoload" command to the README.

Is there anyone here that has/had the problem, but didn't use MAMP?

knibals’s picture

Version: 8.x-1.x-dev » 8.x-1.0-beta2
Component: User interface » Code
Category: Support request » Bug report
Priority: Normal » Critical

#48 Worked for me with 8.x-1.0-beta2

bird-cage’s picture

#48 worked for me

(!) Not MAMP:

Mac os x 10.10 Yosemite
homebrew apache, php, mariadb (not mac's apache and co)
fast-cgi php instead of mod_php
Drupal 8.0.2

In my case the same error occurred at site installation with drush.
We have a complex site which we have been developing for 12 months now. After pulling from our repo I had a fatal (see end of my comment). In the past this same fatal was solved by composer drupal-update which didn't work this time. After a lot of trying and searching, I gave up and did a complete new clone and install which is when the fatal of this issue occurred. I note that due to a sever hardware failure, A week ago I had to reinstall my os, before that I was using mac's apache & php, which suggests it may have something to do with homebrews AMP or that I'm now using fast-cgi php instead of mod_php with apache.

Fatal error: Interface 'CommerceGuys\Addressing\Model\AddressFormatInterface' not found in /Users/xxx/xxx/xxx.de/relaunch/src/modules/contrib/address/src/Entity/AddressFormatInterface.php on line 21

sushantverma.it’s picture

Below are the steps to resolve the issue.
Rebuild the composer.json by command:- composer drupal-rebuild
Update dependencies by command:- composer drupal-update
Activate address module :- drush en address
The above steps enable the "address" module after 2days work. Hopefully helps other too.

weekbeforenext’s picture

#48 worked for me.

barrypoore’s picture

Thanks @bojanz for your comment #54, it's been a while since I looked at this issue so I fired up my install to double check to see if I had tried that, the address module has enabled.

I haven't touched anything or upgraded anything since the previous failed attempts, the same codebase, drupal 8.0.1, just ran composer drupal-update in terminal from the project root, a few updates took place.

Once completed I attempted to enable the address field and it enabled just like it was meant to, all good now.

The only difference in my code will be the updates that took place during composer drupal-update.

neha.gangwar’s picture

#48 worked for me also.

lazzyvn’s picture

It works on my local MAMP Pro El capital
- php modules/composer_manager/scripts/init.php
- composer dumpautoload
- rm -rf vendor/jcalderonzumba/mink-phantomjs-driver
- composer drupal-update
I got error

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Updating jcalderonzumba/gastonjs dev-master (5e231b4 =>21bebb8)        
  [RuntimeException]                                                           
  The .git directory is missing from /Volumes/Data/www/drupal/vendor  
  /jcalderonzumba/gastonjs, see https://getcomposer.org/commit-deps for more   
  information 

but it works i can enable module Addresse

I have host on 1and1 I can not run php modules/composer_manager/scripts/init.php

X-Powered-By: PHP/4.4.9
Content-type: text/html

This script must be run from the command line.

Which file i have to copy to server 1and1?

msypes’s picture

I also received the warning about the missing .git file for /jcalderonzumba/gastonjs after running composer drupal-update, followed by the claims that Address still couldn't find the necessary library.

Adding my kudos for #48. Running composer dumpautoload did the trick.

bojanz’s picture

Category: Bug report » Support request
Priority: Critical » Normal
Status: Active » Fixed

Okay, I've finally installed MAMP, and investigated this whole issue.

What happened in every single one of your cases is Composer not completing at all. You each got an error. You can't ignore that error.
Without Composer completing, the system is in an inconsistent state. The classes shouldn't be found.
What's confusing is that new folders appeared, and that's Composer's fault for not actually performing rollback when the process fails mid-through.

So, you don't need "composer dump-autoload". You need "composer drupal-update" to complete. In most cases that means resolving the "jcalderonzumba/gastonjs' error. Looking at the composer_manager issue queue gives you #2652142: composer drupal-update fails on jcalderonzumba/gastonjs which gives the following solution:

The workaround is to do a "rm -rf vendor/jcalderonzumba/gastonjs" before running composer drupal-update.

For the record, I also setup Address on MAMP, by first installing D8, then downloading Address and Composer Manager into modules, then running:

php modules/composer_manager/scripts/init.php
rm -rf vendor/jcalderonzumba/gastonjs
composer drupal-update

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

mibstar’s picture

Hi @bojanz, I'm having issues with this running on:

DrupalVM: 3.1.4
Drupal: 8.1.7
Address: 8.x-1.0-beta3

I've run:

drupal module:download composer_manager
php modules/contrib/composer_manager/scripts/init.php
cd ../../
rm -rf vendor/jcalderonzumba/gastonjs/
rm -rf vendor/jcalderonzumba/mink-phantomjs-driver/
composer drupal-update
composer dumpautoload
cd drupal/web/; drupal module:install address

[Exception]
address can not be installed: Address requires the commerceguys/addressing library.

Have I missed something?

bojanz’s picture

@mibstar
You are not following the official installation instructions (shown in the README and on the project page), you haven't included the Composer output, and you're commenting on a closed issue.

randell’s picture

#48 worked for me, too.