mstdmstd
3 weeks ago
273
5
Laravel

I got composer install error under php 7.4

Posted 3 weeks ago by mstdmstd

Hello, I try to run laravel 7 under php 7.4 (I worked under php 7.3 before) and I got error:

$ composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)

In ComposerRepository.php line 637:
                                                                                                                                                                   
  Could not load package mews/purifier in http://packagist.org: [UnexpectedValueException] Could not parse version constraint ~4.*: Invalid version string "~4.*"  
                                                                                                                                                                   

In VersionParser.php line 485:
                                                                          
  Could not parse version constraint ~4.*: Invalid version string "~4.*"  

In composer.json:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.2.5",
        "cartalyst/sentinel": "^4.0",
        "cviebrock/eloquent-sluggable": "^7.0",
        "fideloper/proxy": "^4.2",
        "fruitcake/laravel-cors": "^1.0",
        "guzzlehttp/guzzle": "^6.3",
        "illuminate/database": "^7.27",
        "illuminate/events": "^7.27",
        "intervention/image": "dev-master",
        "laravel/framework": "^7.0",
        "laravel/tinker": "^2.0",
        "livewire/livewire": "^1.3",
        "mews/purifier": "^3.2",
        "prettus/l5-repository": "^2.6",
        "realrashid/sweet-alert": "^3.1",
        "spatie/laravel-image-optimizer": "^1.6",
        "spatie/laravel-medialibrary": "^7.19",
        "symfony/http-foundation": "^5.1",
        "wboyz/laravel-enum": "^0.2.1"
    },
    "require-dev": {
        "facade/ignition": "^2.0",
        "fzaninotto/faker": "^1.9.1",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^4.1"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "files": [
            "app/library/helper.php"
        ],

        "psr-4": {
            "App\": "app/",
            "Modules\": "Modules/"
        },
        "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"
        ]
    }
}

Also I removed composer.lock and run again composer update with same results

Is syntax of this file wrong? What have I to change in it?

Thanks!

Please sign in or create an account to participate in this conversation.