0

It has been some time since I did work for my Laravel website, which is running the classic Spark plugin (https://spark-classic.laravel.com/). I am trying to set things up in my Windows WSL2 environment but running into some issues when running composer update.

First of all, the original composer.json contains: "laravel/spark-aurelius": "*@dev",

$ composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/spark-aurelius[dev-master, 10.x-dev] require php ^7.2 -> your php version (8.1.2) does not satisfy that requirement.
    - laravel/spark-aurelius 10.x-dev is an alias of laravel/spark-aurelius dev-master and thus requires it to be installed too.
    - Root composer.json requires laravel/spark-aurelius *@dev -> satisfiable by laravel/spark-aurelius[dev-master, 10.x-dev (alias of dev-master)].

After inspecting the Spark installation website (https://spark-classic.laravel.com/docs/12.0/installation) I noticed the latest Spark package required this

"laravel/spark-aurelius": "~11.0",

So I changed that in the composer.json file. However, after running composer update

$ composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires laravel/spark-aurelius ~11.0, found laravel/spark-aurelius[dev-master, 10.x-dev (alias of dev-master)] but these do not match your constraint and are therefore not installable. Make sure you either fix the constraint or avoid updating this package to keep the one present in the lock file (laravel/spark-aurelius[v11.0.4]).

So I am not sure what to make of it. The problem indicates that although version ~11.0 is specified in the composer.json, a lower version 10.x-dev was found.

This is the complete composer.json

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.2.5|^8.0",
        "aws/aws-sdk-php-laravel": "^3.6",
        "fideloper/proxy": "^4.4",
        "fruitcake/laravel-cors": "^2.0",
        "graham-campbell/flysystem": "^7.1",
        "guzzlehttp/guzzle": "^6.3.1|^7.0.1",
        "laravel/framework": "^7.29",
        "laravel/spark-aurelius": "~11.0",
        "laravel/tinker": "^2.5",
        "laravel/ui": "^2.0",
        "laravelcollective/html": "^6.2",
        "league/flysystem-aws-s3-v3": "^1.0",
        "mpociot/vat-calculator": "^2.4",
        "shiftonelabs/laravel-sqs-fifo-queue": "^2.0",
        "uxweb/sweet-alert": "^2.0"
    },
    "require-dev": {
        "facade/ignition": "^2.0",
        "fakerphp/faker": "^1.9.1",
        "mockery/mockery": "^1.3.1",
        "nunomaduro/collision": "^4.3",
        "phpunit/phpunit": "^8.5.8|^9.3.3"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    },

    "repositories": [
        {
            "type": "path",
            "url": "./spark"
        }
    ]
}

Why isn't this lower version updated?

matiaslauriti
  • 7,065
  • 4
  • 31
  • 43
helloworld
  • 223
  • 1
  • 7
  • 24
  • Try `composer update -W` – matiaslauriti Mar 12 '23 at 14:15
  • thanks matiaslauriti, i tried that, but the same error appears – helloworld Mar 12 '23 at 16:52
  • Please, share your full current `composer.json` file – matiaslauriti Mar 12 '23 at 18:40
  • added the composer.json content in the main question – helloworld Mar 12 '23 at 19:31
  • 1
    I do not have access to `laravel/spark-aurelius`, because it is paid, so I cannot see it's `composer.json`, but the error says you want `11.x` and you have `10.x`, so you need to download a new version, or instead of downloading a package, use the private repository as it says on the section `Installation Via Composer` on the documentation that you have shared – matiaslauriti Mar 12 '23 at 19:53
  • You're right, it's a paid package. That might be the culprit. I see the following on the website: "Next, run the composer update command. You may be prompted for a GitHub token in order to install the private Spark repository." I probably should look into getting the link functional with my account. – helloworld Mar 12 '23 at 20:02
  • If you don't use the link, you will never update the content, because it is local, so composer does nothing (does not download anything, just checks what you have in there, and sees it is still the previous version). This is similar to Laravel Nova (if you have used it) – matiaslauriti Mar 12 '23 at 20:06
  • 1
    I had forgotten about that link. I installed Spark once in the beginning, and later on, migrated to version 10. Not sure if I needed to request the token again but I do remember doing it in the beginning. I shall investigate how to redo this! Thanks for the pointer, I will come back and tell if it fixed the issue. – helloworld Mar 12 '23 at 20:34

1 Answers1

1

Two things I had to solve, first add the repository mentioned in https://spark-satis.laravel.com/ into the composer.json, which wasn't there before.

Next problem was the fact php8.1 was installed by default. Uninstalled, and installed php7.4

Thanks matiaslauriti for point me into the right direction.

helloworld
  • 223
  • 1
  • 7
  • 24