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

Installation error #20

Closed
amitgoyal opened this issue May 22, 2019 · 15 comments
Closed

Installation error #20

amitgoyal opened this issue May 22, 2019 · 15 comments

Comments

@amitgoyal
Copy link

Hi - I am using latest version of Drupal 8.8.x (commit 9a3477e83b9ae358ba7288a842b571e85b8e1793) but when I try to install drupal8-rector, I am getting following issues,

`
➜ d9 git:(8.8.x) ✗ composer require --dev drupal8-rector/drupal8-rector
1/2: http://repo.packagist.org/p/provider-latest$d21f81ccc7a4e0aa6dd05bda6641635b6798db583841db2aba7ec37276b7334d.json
2/2: http://repo.packagist.org/p/provider-2018-07$05514ee5642c8a8c5edaa1f0512a38e5fd7bef7db440185f3f91b79d995666dd.json
Finished: success: 2, skipped: 0, failure: 0, total: 2
Using version ^0.1.0 for drupal8-rector/drupal8-rector
./composer.json has been updated
1/3: http://repo.packagist.org/p/provider-latest$a9e2e19cecf04979cd1f6a366cf83dd9153302ed66298632471079983bc37ff8.json
2/3: http://repo.packagist.org/p/provider-2019-04$9823a8e102db891185800a2f241561a62027208f3355a8689a63714ae3a84c9e.json
3/3: http://repo.packagist.org/p/provider-2018$4d03824f9c752e4d939c278094fe0764b85da988c987208070f10584a1196c83.json
Finished: success: 3, skipped: 0, failure: 0, total: 3
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
- drupal8-rector/drupal8-rector 0.1.0 requires rector/rector 0.4.4 -> satisfiable by rector/rector[v0.4.4].
- Installation request for drupal8-rector/drupal8-rector ^0.1.0 -> satisfiable by drupal8-rector/drupal8-rector[0.1.0].
- Conclusion: remove sebastian/diff 1.4.3
- Conclusion: don't install sebastian/diff 1.4.3
- rector/rector v0.4.4 requires sebastian/diff ^3.0 -> satisfiable by sebastian/diff[3.0.0, 3.0.1, 3.0.2, 3.0.x-dev].
- Can only install one of: sebastian/diff[3.0.0, 1.4.3].
- Can only install one of: sebastian/diff[3.0.1, 1.4.3].
- Can only install one of: sebastian/diff[3.0.2, 1.4.3].
- Can only install one of: sebastian/diff[3.0.x-dev, 1.4.3].
- Installation request for sebastian/diff (locked at 1.4.3) -> satisfiable by sebastian/diff[1.4.3].

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

@mxr576
Copy link
Collaborator

mxr576 commented May 22, 2019

Hi @amitgoyal, this is a Known issue: https://github.com/drupal8-rector/drupal8-rector#known-issues Try to remove PHPUnit or install Drupal 8 rector globally with composer global require...

@amitgoyal
Copy link
Author

Hi @mxr576 - Thanks for your quick reply! Actually I tried removing packages but couldn't install the library. Not sure if I am doing something wrong,

➜ d9 git:(8.8.x) ✗ composer global remove phpunit/phpunit

Changed current directory to /Users/amit.goyal/.composer
phpunit/phpunit is not required in your composer.json and has not been removed
Package "phpunit/phpunit" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
➜ d9 git:(8.8.x) ✗ composer global remove webflo/drupal-core-require-dev

Changed current directory to /Users/amit.goyal/.composer
webflo/drupal-core-require-dev is not required in your composer.json and has not been removed
Package "webflo/drupal-core-require-dev" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
➜ d9 git:(8.8.x) ✗ composer require --dev drupal8-rector/drupal8-rector
Using version ^0.1.0 for drupal8-rector/drupal8-rector
./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
- drupal8-rector/drupal8-rector 0.1.0 requires rector/rector 0.4.4 -> satisfiable by rector/rector[v0.4.4].
- Installation request for drupal8-rector/drupal8-rector ^0.1.0 -> satisfiable by drupal8-rector/drupal8-rector[0.1.0].
- Conclusion: remove sebastian/diff 2.0.1
- Conclusion: don't install sebastian/diff 2.0.1
- rector/rector v0.4.4 requires sebastian/diff ^3.0 -> satisfiable by sebastian/diff[3.0.0, 3.0.1, 3.0.2, 3.0.x-dev].
- Can only install one of: sebastian/diff[3.0.0, 2.0.1].
- Can only install one of: sebastian/diff[3.0.1, 2.0.1].
- Can only install one of: sebastian/diff[3.0.2, 2.0.1].
- Can only install one of: sebastian/diff[3.0.x-dev, 2.0.1].
- Installation request for sebastian/diff (locked at 2.0.1) -> satisfiable by sebastian/diff[2.0.1].

Installation failed, reverting ./composer.json to its original content.
➜ d9 git:(8.8.x) ✗

@mxr576
Copy link
Collaborator

mxr576 commented May 22, 2019

Try to figure out what depends on sebastian/diff in your setup:
composer why sebastian/diff

Try to remove the sebastian/diff if it is possible. But probably it is better for you if you install drupal8-rector globally with composer global require drupal8-rector/drupal8-rector

@amitgoyal
Copy link
Author

Actually I have vanilla Drupal 8.8.x on my local. Nothing much have been setup as such. I also tried setting up globally but that also didn't work. Looks like lot of mess on my system.

➜ d9 git:(8.8.x) ✗ composer why sebastian/diff

phpunit/phpunit 6.5.14 requires sebastian/diff (^2.0)
sebastian/comparator 2.1.3 requires sebastian/diff (^2.0 || ^3.0)

➜ d9 git:(8.8.x) ✗ composer global require drupal8-rector/drupal8-rector
Changed current directory to /Users/amit.goyal/.composer
1/6: http://repo.packagist.org/p/provider-latest$50d6a760991ce5976bf2bf3d8a71be90cd5cf3989e2a19c6771ae8b11d8a62ca.json
2/6: http://repo.packagist.org/p/provider-2019-04$559ca0e808e1ecea59fc8d2c8691cdca7b25f8456e71e9c05458094b275aeded.json
3/6: http://repo.packagist.org/p/provider-2018-07$d0f92f88f5354a03f412af0a4b85bbf77268b370c4d5e5199c069871d7827a47.json
4/6: http://repo.packagist.org/p/provider-2018-10$5ae49844e9f1c7a6c0a7097990ae393e17f66b12beefbce91560eb3a236e911d.json
5/6: http://repo.packagist.org/p/provider-2019-01$f215fa497bbe1e0b3844ba679c4db48c6eab837f500a0b74e65e85d82567e14b.json
6/6: http://repo.packagist.org/p/provider-2018$2e9105b609df52da64cf5880c81a9412061db9ded8fa356dd715ea721206aeec.json
Finished: success: 6, skipped: 0, failure: 0, total: 6
Using version dev-master for drupal8-rector/drupal8-rector
./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
- drupal8-rector/drupal8-rector dev-master requires rector/rector 0.4.12 -> satisfiable by rector/rector[v0.4.12].
- Installation request for drupal8-rector/drupal8-rector dev-master -> satisfiable by drupal8-rector/drupal8-rector[dev-master].
- Conclusion: remove nikic/php-parser 3.x-dev
- Conclusion: don't install nikic/php-parser 3.x-dev
- rector/rector v0.4.12 requires nikic/php-parser ^4.2.1 -> satisfiable by nikic/php-parser[4.2.x-dev, v4.2.1].
- Can only install one of: nikic/php-parser[4.2.x-dev, 3.x-dev].
- Can only install one of: nikic/php-parser[v4.2.1, 3.x-dev].
- Installation request for nikic/php-parser (locked at 3.x-dev) -> satisfiable by nikic/php-parser[3.x-dev].

Installation failed, reverting ./composer.json to its original content.
➜ d9 git:(8.8.x) ✗

@mxr576
Copy link
Collaborator

mxr576 commented May 22, 2019

composer global why nikic/php-parser :) I guess you have Drush installed... but this is a dependency conflict issue in your dev env that I can not resolve to be honest.

@amitgoyal
Copy link
Author

Thanks @mxr576, I will update the issue in case it worked for me.

@mondrake
Copy link

@amitgoyal you might try applying the patch that allows PHPUnit 7 to be installed in D8.8 https://www.drupal.org/project/drupal/issues/2950132

@joshirohit100
Copy link

@mondrake I tried the patch on https://www.drupal.org/project/drupal/issues/2950132 and patch applied successfully but still getting below errors due to composer dependencies.

➜  drupal8 git:(8.8.x) ✗ composer require --dev drupal8-rector/drupal8-rector


Using version ^0.1.0 for drupal8-rector/drupal8-rector
./composer.json has been updated
> Drupal\Core\Composer\Composer::ensureComposerVersion
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
    - drupal8-rector/drupal8-rector 0.1.0 requires rector/rector 0.4.4 -> satisfiable by rector/rector[v0.4.4].
    - Installation request for drupal8-rector/drupal8-rector ^0.1.0 -> satisfiable by drupal8-rector/drupal8-rector[0.1.0].
    - Conclusion: remove sebastian/diff 2.0.1
    - Conclusion: don't install sebastian/diff 2.0.1
    - rector/rector v0.4.4 requires sebastian/diff ^3.0 -> satisfiable by sebastian/diff[3.0.0, 3.0.1, 3.0.2, 3.0.x-dev].
    - Can only install one of: sebastian/diff[3.0.0, 2.0.1].
    - Can only install one of: sebastian/diff[3.0.1, 2.0.1].
    - Can only install one of: sebastian/diff[3.0.2, 2.0.1].
    - Can only install one of: sebastian/diff[3.0.x-dev, 2.0.1].
    - Installation request for sebastian/diff (locked at 2.0.1) -> satisfiable by sebastian/diff[2.0.1].


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

cc @amitgoyal

@mondrake
Copy link

mondrake commented Sep 3, 2019

@joshirohit100 @amitgoyal difficult to say... try to upgrade the dependencies AFTER applying the patch and BEFORE requiring drupal8-rector/drupal8-rector:

composer update phpunit/phpunit symfony/phpunit-bridge phpspec/prophecy symfony/yaml --with-dependencies --no-progress

then
composer require drupal8-rector/drupal8-rector

@mondrake
Copy link

mondrake commented Sep 3, 2019

See draft CR https://www.drupal.org/node/3078763

@mondrake
Copy link

mondrake commented Sep 3, 2019

The following worked for me:

$ git clone --depth=5 http://git.drupal.org/project/drupal.git

$ cd drupal

$ composer install

$ git apply -v [mypath]/2950132-116-no-drupalci-changes.patch

$ composer update phpunit/phpunit symfony/phpunit-bridge phpspec/prophecy symfony/yaml --with-dependencies --no-progress

$ composer require drupal8-rector/drupal8-rector

Do not run Composer as root/super user! See https://getcomposer.org/root for details
Using version ^0.1.0 for drupal8-rector/drupal8-rector
./composer.json has been updated
> Drupal\Core\Composer\Composer::ensureComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 21 installs, 0 updates, 0 removals
  - Installing ocramius/package-versions (1.5.1): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/config (v4.3.4): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing nette/utils (v2.5.3): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing nette/finder (v2.5.0): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing nesbot/carbon (2.24.0): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing psr/simple-cache (1.0.1): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing illuminate/contracts (v5.8.34): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing illuminate/support (v5.8.34): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symplify/package-builder (v5.4.16): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing nikic/php-parser (v4.2.4): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing phpstan/phpdoc-parser (0.3.5): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing nette/robot-loader (v3.1.1): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing nette/php-generator (v3.2.3): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing nette/neon (v3.0.0): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing nette/di (v2.4.15): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing nette/bootstrap (v2.4.6): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing jean85/pretty-package-versions (1.2): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing phpstan/phpstan (0.11.6): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing rector/rector (v0.4.4): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing jawira/case-converter (v1.2.0): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing drupal8-rector/drupal8-rector (0.1.0): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
nette/utils suggests installing ext-intl (for script transliteration in Strings::webalize() and toAscii())
illuminate/support suggests installing illuminate/filesystem (Required to use the composer class (5.8.*).)
illuminate/support suggests installing moontoast/math (Required to use ordered UUIDs (^1.1).)
illuminate/support suggests installing ramsey/uuid (Required to use Str::uuid() (^3.7).)
illuminate/support suggests installing symfony/var-dumper (Required to use the dd function (^4.2).)
illuminate/support suggests installing vlucas/phpdotenv (Required to use the env helper (^3.3).)
nette/bootstrap suggests installing tracy/tracy (to use Configurator::enableTracy())
rector/rector suggests installing symplify/easy-coding-standard (Required to enable '--with-style' option. Use in case you don't have PHP_CodeSniffer or PHP-CS-Fixer yet.)
jawira/case-converter suggests installing pds/skeleton (PHP Package Development Standards)
Writing lock file
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
> Drupal\Core\Composer\Composer::ensureHtaccess
    Skipped installation of bin bin/composer for package composer/composer: file not found in package
...



@amitgoyal
Copy link
Author

Thanks @mondrake, this worked for me as well.

cc: @joshirohit100

@seanr
Copy link

seanr commented Dec 20, 2019

You can apparently now do this without the patch:

$ git clone --depth=5 http://git.drupal.org/project/drupal.git
$ cd drupal
$ composer install
$ composer update phpunit/phpunit symfony/phpunit-bridge phpspec/prophecy symfony/yaml --with-dependencies --no-progress
$ composer require drupal8-rector/drupal8-rector

See https://www.drupal.org/node/3078763 for the change record.

@mxr576
Copy link
Collaborator

mxr576 commented Dec 24, 2019

Probably it is going to be the best in the longterm run if we also phar-ify Drupal 8 Rector, just like Tomas did with Rector recently.
https://www.tomasvotruba.cz/blog/2019/12/02/how-to-box-symfony-app-to-phar-without-killing-yourself/

@mxr576
Copy link
Collaborator

mxr576 commented Dec 24, 2019

Closed in favor of #38.

@mxr576 mxr576 closed this as completed Dec 24, 2019
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