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

Composer trying to install older version #11965

Open
sobhan-m94 opened this issue May 6, 2024 · 2 comments
Open

Composer trying to install older version #11965

sobhan-m94 opened this issue May 6, 2024 · 2 comments
Labels

Comments

@sobhan-m94
Copy link

My composer.json:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The skeleton application for the Laravel framework.",
    "keywords": [
        "laravel",
        "framework"
    ],
    "license": "MIT",
    "require": {
        "php": "^8.2",
        "hekmatinasser/verta": "^8.4",
        "jenssegers/agent": "^2.6",
        "laravel/framework": "^11.0",
        "laravel/sanctum": "^4.0",
        "laravel/tinker": "^2.9",
        "predis/predis": "^2.0"
    },
    "require-dev": {
        "fakerphp/faker": "^1.23",
        "laravel/pint": "^1.13",
        "laravel/sail": "^1.29",
        "mockery/mockery": "^1.6",
        "nunomaduro/collision": "^8.0",
        "pestphp/pest": "^2.34",
        "pestphp/pest-plugin-laravel": "^2.3",
        "spatie/laravel-ignition": "^2.4"
    },
    "autoload": {
        "files": [
            "app/helpers.php"
        ],
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/",
            "Database\\Parents\\": "database/parents/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi",
            "@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
            "@php artisan migrate --graceful --ansi"
        ]
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true,
        "allow-plugins": {
            "pestphp/pest-plugin": true,
            "php-http/discovery": true
        }
    },
    "minimum-stability": "stable",
    "prefer-stable": true
}

Output of composer diagnose:

Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK git version 2.34.1
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys: 
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking Composer version: You are not running the latest stable version, run `composer self-update` to update (2.7.4 => 2.7.6)
Checking Composer and its dependencies for vulnerabilities: OK
Composer version: 2.7.4
PHP version: 8.3.6
PHP binary path: /usr/bin/php8.3
OpenSSL version: OpenSSL 3.0.2 15 Mar 2022
cURL version: 7.81.0 libz 1.2.11 ssl OpenSSL/3.0.2
zip: extension present, unzip present, 7-Zip not available

When I run this command:

composer require laravel/jetstream 

I get the following output:

./composer.json has been updated
Running composer update laravel/jetstream
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/jetstream[v0.0.1, ..., v0.7.3, v1.0.0, ..., v1.5.3] require php ^7.3 -> your php version (8.3.6) does not satisfy that requirement.
    - laravel/jetstream[v1.6.0, ..., v1.6.7, v2.0.0, ..., v2.5.1] require illuminate/support ^8.0 -> found illuminate/support[v8.0.0, ..., v8.83.27] but these were not loaded, likely because it conflicts with another require.
    - laravel/jetstream[v1.7.0, ..., v1.7.2, v2.6.0, ..., v2.6.6] require illuminate/support ^8.0|^9.0 -> found illuminate/support[v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.16] but these were not loaded, likely because it conflicts with another require.
    - laravel/jetstream[v2.6.7, ..., v2.9.0] require illuminate/support ^8.37|^9.0 -> found illuminate/support[v8.37.0, ..., v8.83.27, v9.0.0, ..., v9.52.16] but these were not loaded, likely because it conflicts with another require.
    - laravel/jetstream[v2.10.0, ..., v2.10.1] require illuminate/support ^9.0 -> found illuminate/support[v9.0.0, ..., v9.52.16] but these were not loaded, likely because it conflicts with another require.
    - laravel/jetstream[v2.10.2, ..., v2.14.1] require illuminate/console ^9.21 -> found illuminate/console[v9.21.0, ..., v9.52.16] but these were not loaded, likely because it conflicts with another require.
    - laravel/jetstream[v2.15.0, ..., v2.16.2, v3.0.0, ..., v3.0.2] require illuminate/console ^9.21|^10.0 -> found illuminate/console[v9.21.0, ..., v9.52.16, v10.0.0, ..., v10.48.10] but these were not loaded, likely because it conflicts with another require.
    - laravel/jetstream[v3.1.0, ..., v3.2.5] require illuminate/console ^10.0 -> found illuminate/console[v10.0.0, ..., v10.48.10] but these were not loaded, likely because it conflicts with another require.
    - laravel/jetstream[v3.3.0, ..., v3.3.3, v4.0.0, ..., v4.3.1] require illuminate/console ^10.17 -> found illuminate/console[v10.17.0, ..., v10.48.10] but these were not loaded, likely because it conflicts with another require.
    - laravel/jetstream[v5.0.0, ..., v5.0.5] require mobiledetect/mobiledetectlib ^4.8 -> found mobiledetect/mobiledetectlib[4.8.01, ..., 4.8.06] but the package is fixed to 2.8.45 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - Root composer.json requires laravel/jetstream * -> satisfiable by laravel/jetstream[v0.0.1, ..., v0.7.3, v1.0.0, ..., v1.7.2, v2.0.0, ..., v2.16.2, v3.0.0, ..., v3.3.3, v4.0.0, ..., v4.3.1, v5.0.0, ..., v5.0.5].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require laravel/jetstream:*" to figure out if any version is installable, or "composer require laravel/jetstream:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

And I expected this to happen:
Install laravel jetstream!

@xabbuh
Copy link
Contributor

xabbuh commented May 6, 2024

laravel/jetstream up to 4.x is not compatible with Laravel 10, but 5.0 which is compatible requires a version of mobiledetect/mobiledetectlib that is not compatible with your jenssegers/agent dependency. I guess you need to figure out if there is an alternative to jenssegers/agent.

@Seldaek
Copy link
Member

Seldaek commented May 21, 2024

Or update mobiledetect/mobiledetectlib by doing composer require laravel/jetstream -W -m (--update-with-all-dependencies --minimal-changes) which might help resolve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants