Composer fails to install laravel/socialite 2.0

composer require laravel/socialite ^2.0

is failing with below error:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for laravel/socialite 2.0 -> satisfiable by laravel/socialite[v2.0.0].
    - Conclusion: remove guzzlehttp/guzzle 6.2.2
    - Conclusion: don't install guzzlehttp/guzzle 6.2.2
    - laravel/socialite v2.0.0 requires guzzlehttp/guzzle ~4.0 -> satisfiable by guzzlehttp/guzzle[4.0.0, 4.0.1, 4.0.2, 4.1.0, 4.1.1, 4.1.2, 4.1.3, 4.1.4, 4.1.5, 4.1.6, 4.1.7, 4.1.8, 4.2.0, 4.2.1, 4.2.2, 4.2.3, 4.2.4].
    - Can only install one of: guzzlehttp/guzzle[4.0.0, 6.2.2].
    ...
    - Can only install one of: guzzlehttp/guzzle[4.2.4, 6.2.2].
    - Installation request for guzzlehttp/guzzle (locked at 6.2.2) -> satisfiable by guzzlehttp/guzzle[6.2.2].


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

Laravel version is 5.3.22

PHP version is 7.0.10

The composer.json of socialite2.0 on github shows the dependency as guzzlehttp 5.0/ 6.0. Why's my install looking for guzzlehttp 4.0?

EDIT-1:

I tried to force guzzlehttp 4.2.4 by adding it in composer.json require-dev.

However, I received following error:

  Problem 1
    - The requested package guzzlehttp/guzzle (locked at 6.2.2, required as 4.2.4) is satisfiable by guzzlehttp/guzzle[6.2.2] but these conflict with your requirements or minimum-stability.
  Problem 2
    - aws/aws-sdk-php 3.19.23 requires guzzlehttp/guzzle ^5.3.1|^6.2.1 -> satisfiable by guzzlehttp/guzzle[5.3.1, 5.3.2, 5.3.x-dev, 6.2.1, 6.2.2, 6.2.3, 6.3.0, 6.2.x-dev] but these conflict with your requirements or minimum-stability.
    - aws/aws-sdk-php 3.19.23 requires guzzlehttp/guzzle ^5.3.1|^6.2.1 -> satisfiable by guzzlehttp/guzzle[5.3.1, 5.3.2, 5.3.x-dev, 6.2.1, 6.2.2, 6.2.3, 6.3.0, 6.2.x-dev] but these conflict with your requirements or minimum-stability.
    - aws/aws-sdk-php 3.19.23 requires guzzlehttp/guzzle ^5.3.1|^6.2.1 -> satisfiable by guzzlehttp/guzzle[5.3.1, 5.3.2, 5.3.x-dev, 6.2.1, 6.2.2, 6.2.3, 6.3.0, 6.2.x-dev] but these conflict with your requirements or minimum-stability.
    - Installation request for aws/aws-sdk-php (locked at 3.19.23) -> satisfiable by aws/aws-sdk-php[3.19.23].

Apparently, aws-sdk-php requires guzzlehttp 5.3/ 6.2. Laravel 5.3 is not compatible with socialite 3.0. Socialite 2.0 is not compatible with guzzlehttp 5.3/ 6.2.

How to resolve this?

TIA

EDIT-2:

my composer.json has below content:

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "php": ">=5.6.4",
    "laravel/framework": "5.3.*",
    "doctrine/dbal": "^2.5",
    "aws/aws-sdk-php-laravel": "~3.0"
},
"require-dev": {
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~5.0",
    "symfony/css-selector": "3.1.*",
    "symfony/dom-crawler": "3.1.*"
},
"autoload": {
    "classmap": [
        "database"
    ],
    "psr-4": {
        "App\\": "app/"
    }
},
"autoload-dev": {
    "classmap": [
        "tests/TestCase.php"
    ]
},
"scripts": {
    "post-root-package-install": [
        "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ],
    "post-install-cmd": [
        "Illuminate\\Foundation\\ComposerScripts::postInstall",
        "php artisan optimize"
    ],
    "post-update-cmd": [
        "Illuminate\\Foundation\\ComposerScripts::postUpdate",
        "php artisan optimize"
    ]
},
"config": {
    "preferred-install": "dist"
}

}

Here's how the issue got resolved: It turned out to be simple. As I'm still learning what composer can do, I couldn't figure it out earlier.

Changing from ^ to ~ in the version did the trick. As per Mastering Composer - tips & tricks, both tilde (~) & caret (^) should allow minor versions in the packages. But, it appears "only be careful of breaking changes" took the precedence over allowing minor versions. (at least, that's the conclusion I arrived at).

Following is the result:

composer require laravel/socialite:~2.0
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Installing league/oauth1-client (1.7.0): Downloading (100%)
  - Installing laravel/socialite (v2.0.21): Downloading (100%)
Writing lock file
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize
Generating optimized class loader
Compiling common classes

Problems to install Laravel Socialite (I'm using Laravel 5.6), When I'm trying to install Laravel Socialite package I get this problem- C:\xampp\ htdocs\forum>composer require laravel/socialite Using version ^4. Installation failed, reverting ./composer.json to its original content. if I use: composer require laravel/socialite ^2.0 I get:

I have one idea of this problem.

In composer.lock, save a hash and version of package that you download with your composer config, in this moment or an another time. Then delete this file and vendor folder and execute again:

composer require laravel/socialite ^2.0

Cannot install laravel/socialite for Laravel 5.3, I am unable to install laravel/socialite with: composer require laravel/socialite I ( 4.2.4) Downloading: 100% - Installing laravel/socialite (v2.0.0) Downloading:� I'm trying to deploy a basic Laravel application to Cloud Foundry on IBM Cloud. Below you can see the output after I ran ibmcloud cf push: Invoking 'c

Try:

composer require laravel/socialite

Hope it will help.

See: Laravel documentation.

关于php:Composer无法安装laravel / socialite 2.0, Composer fails to install laravel/socialite 2.0作曲者需要laravel / socialite ^ 2.0 失败并出现以下错误:[cc lang=php]Your requirements could not� A new command-line option --ignore-platform-req is added to composer install and composer update commands. This option can be used to selectively ignore one or more platform requirements. This option can be used to selectively ignore one or more platform requirements.

Try this : composer require laravel/socialite:~2.0 It Work for me :)

Laravel 5.3 socialite installation error, Laravel 5.3 socialite installation error - php. I'm trying to install socialite 2.0 on laravel 5.2 via composer but it gives me an error: The requested package� Laravel Authentication Log provides authentication logger and notification when you login from a new device - yadahan/laravel-authentication-log

laravel/socialite, Laravel Socialite provides an expressive, fluent interface to OAuth authentication with Facebook, Twitter, Google, LinkedIn, GitHub, GitLab and� For instance, laravel new blog will create a directory named blog containing a fresh Laravel installation with all of Laravel's dependencies already installed: laravel new blog Via Composer Create-Project. Alternatively, you may also install Laravel by issuing the Composer create-project command in your terminal:

php - Composer无法安装laravel / socialite 2.0, Composer fails to install laravel/socialite 2.0. 发表于 2018-01-24 16:32:40. 活跃于 2019-03-22 09:43:13. 查看1919 次. php laravel composer-php� Laravel's laravel/ui package provides a quick way to scaffold all of the routes and views you need for authentication using a few simple commands: composer require laravel/ui php artisan ui vue --auth

laravel/socialite, Laravel Socialite provides an expressive, fluent interface to OAuth authentication with Facebook, Twitter, Google, LinkedIn, GitHub, GitLab and Bitbucket. Laravel Telescope is an elegant debug assistant for the Laravel framework. Telescope provides insight into the requests coming into your application, exceptions, log entries, database queries, queued jobs, mail, notifications, cache operations, scheduled tasks, variable dumps and more.

Comments
  • Can you post your composer.json file?
  • One possibility is install at old version of aws/aws-sdk-php for example 2.8 version of this package
  • Another solution is update your laravel version to 5.3 at 5.4, your system supported requisites. github.com/laravel/framework/blob/5.4/composer.json
  • @ThomasEdwards, I posted composer.json. adding guzzlehttp 4.2.4 to require-dev revealed aws-sdk-php dependency. upgrading Laravel version or downgrading aws-sdk-php requires lot of effort, to validate the application. Unfortunately, that's not an option..
  • BTW, my primary requirement is to allow users to post photos to FB/Twitter/G+ from our website (NOT the links). Is there any alternative available to achieve this?
  • this comand download 3.0 version of socialite, but @krsna want 2.0v, And socialite 3.0 version required minimum 5.4v of Laravel. This not a option and solution
  • Version doesn't matter it will work properly. I think he has little confusion if he download latest version then code will not work