magento-hackathon / magento-composer-installer

Composer installer for Magento modules
210 stars 154 forks source link

Fatal error: Cannot use Composer\Installer as Installer because the name is already in use in phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php(195) : eval()'d code on line 13 #197

Open magicento opened 7 years ago

magicento commented 7 years ago

` - Installing composer/semver (1.4.2) Loading from cache

Fatal error: Cannot use Composer\Installer as Installer because the name is already in use in phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php(195) : eval()'d code on line 13 `

Flyingmana commented 7 years ago

how can I reproduce this?

cyxddgithub commented 7 years ago

hi @Flyingmana i also meet this problem.

composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition ./e_commerce_magento/ Installing magento/project-community-edition (2.1.5)

Created project in ./e_commerce_magento/ Loading composer repositories with package information ...

PHP Fatal error: Cannot use Composer\Installer as Installer because the name is already in use in phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php(193) : eval()'d code on line 13

Flyingmana commented 7 years ago

@cyxddgithub your error occures for Magento2, where the "magento-hackathon/magento-composer-installer" should not be used for (its only for magento1) seems like this M2 related bug should be reported to magento instead

davidverholen commented 7 years ago

just an idea: do you maybe have the hackathon composer installer installed globally? you should be able to see that with composer global show -i (the -i param is only needed in older composer versions)

cyxddgithub commented 7 years ago

@davidverholen here is my composer show result seem lick no global install it: Changed current directory to /home/vagrant/.composer doctrine/inflector v1.1.0 Common String Manipulations with regard to casing and singular/plural rules. guzzlehttp/guzzle 6.2.0 Guzzle is a PHP HTTP client library guzzlehttp/promises 1.2.0 Guzzle promises library guzzlehttp/psr7 1.3.1 PSR-7 message implementation illuminate/contracts v5.2.37 The Illuminate Contracts package. illuminate/support v5.2.37 The Illuminate Support package. laravel/envoy v1.2.0 Elegant SSH tasks for PHP. laravel/installer v1.3.3 Laravel application installer. nategood/httpful 0.2.20 A Readable, Chainable, REST friendly, PHP HTTP Client paragonie/random_compat v1.4.1 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7 psr/http-message 1.0 Common interface for HTTP messages symfony/console v3.1.1 Symfony Console Component symfony/polyfill-mbstring v1.2.0 Symfony polyfill for the Mbstring extension symfony/process v3.1.1 Symfony Process Component

@Flyingmana got it i have try report it in magento2 issue

davidverholen commented 7 years ago

I think it's still another problem, since magento 2 would not require the hackathon composer installer. Try executing

composer why magento-hackathon/magento-composer-installer

it should show you the module, that requires the hackathon installer. Most likely you have a Magento1 Module in your requirements