laravel/framework[v10.0.0, …, v10.1.5] cannot be installed as that would require removing laravel/laravel[dev-master]

huangapple go评论60阅读模式
英文:

laravel/framework[v10.0.0, ..., v10.1.5] cannot be installed as that would require removing laravel/laravel[dev-master]

问题

I'm trying to upgrade my Laravel app from version 9 to 10. After making the necessary changes to the composer.json file, I encountered the following error:

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

  Problem 1
    - laravel/framework[v10.0.0, ..., v10.1.5] cannot be installed as that would require removing laravel/laravel[dev-master]. They all replace illuminate/support and thus cannot coexist.
    - laravel/laravel is present at version dev-master and cannot be modified by Composer
    - Root composer.json requires laravel/framework ^10.0 -> satisfiable by laravel/framework[v10.0.0, ..., v10.1.5].

What am I doing wrong?

EDIT: I am running composer update.

Here is my full composer.json if someone is interested:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "minimum-stability": "stable",
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">= 8.1",
        "doctrine/dbal": "^3.0",
        "fakerphp/faker": "^1.9.1",
        "fruitcake/php-cors": "^1.2",
        "guzzlehttp/guzzle": "^7.4",
        "kylekatarnls/laravel-carbon-2": "^1.0.0",
        "laravel/framework": "^10.0",
        "laravel/helpers": "^1.2",
        "laravel/tinker": "^2.0",
        "laravelcollective/html": "^6.0",
        "nesbot/carbon": "^2.5",
        "sentry/sentry-laravel": "^3.0",
        "srmklive/paypal": "~3.0",
        "stripe/stripe-php": "^7.0.0",
        "symfony/console": "^6.2",
        "symfony/error-handler": "^6.2",
        "symfony/finder": "^6.2",
        "symfony/http-foundation": "^6.2",
        "symfony/http-kernel": "^6.2",
        "symfony/mailer": "^6.2",
        "symfony/mime": "^6.2",
        "symfony/process": "^6.2",
        "symfony/routing": "^6.2",
        "symfony/uid": "^6.2",
        "symfony/var-dumper": "^6.2"
    },
    "replace": {
        "illuminate/support": "self.version"
    },
    "require-dev": {
        "mockery/mockery": "^1.4.1",
        "nunomaduro/collision": "^7.0",
        "phpunit/phpunit": "^10.0"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        },
        "files": [
            "app/Helpers/Helper.php",
            "src/Illuminate/Support/helpers.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "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"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true,
        "allow-plugins": {
            "pestphp/pest-plugin": true
        }
    }
}

Hope this helps!

英文:

Trying to upgrade my laravel app to 10 from 9. Getting this error after the changes required in composer json. Normally I know how to fix these types of errors since most of the time there is a package that you forgot to update. But from this error msg I can't really figure out what to do?

Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/framework[v10.0.0, ..., v10.1.5] cannot be installed as that would require removing laravel/laravel[dev-master]. They all replace illuminate/support and thus cannot coexist.
- laravel/laravel is present at version dev-master and cannot be modified by Composer
- Root composer.json requires laravel/framework ^10.0 -> satisfiable by laravel/framework[v10.0.0, ..., v10.1.5].

What am i doing wrong?

EDIT: I am running composer update

Here is my full composer.json if someone is interested:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "minimum-stability": "stable",
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">= 8.1",
        "doctrine/dbal": "^3.0",
        "fakerphp/faker": "^1.9.1",
        "fruitcake/php-cors": "^1.2",
        "guzzlehttp/guzzle": "^7.4",
        "kylekatarnls/laravel-carbon-2": "^1.0.0",
        "laravel/framework": "^10.0",
        "laravel/helpers": "^1.2",
        "laravel/tinker": "^2.0",
        "laravelcollective/html": "^6.0",
        "nesbot/carbon": "^2.5",
        "sentry/sentry-laravel": "^3.0",
        "srmklive/paypal": "~3.0",
        "stripe/stripe-php": "^7.0.0",
        "symfony/console": "^6.2",
        "symfony/error-handler": "^6.2",
        "symfony/finder": "^6.2",
        "symfony/http-foundation": "^6.2",
        "symfony/http-kernel": "^6.2",
        "symfony/mailer": "^6.2",
        "symfony/mime": "^6.2",
        "symfony/process": "^6.2",
        "symfony/routing": "^6.2",
        "symfony/uid": "^6.2",
        "symfony/var-dumper": "^6.2"
    },
    "replace": {
        "illuminate/support": "self.version"
    },
    "require-dev": {
        "mockery/mockery": "^1.4.1",
        "nunomaduro/collision": "^7.0",
        "phpunit/phpunit": "^10.0"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        },
        "files": [
            "app/Helpers/Helper.php",
            "src/Illuminate/Support/helpers.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "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"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true,
        "allow-plugins": {
            "pestphp/pest-plugin": true
        }
    }
}

答案1

得分: 0

这是你提供的 JSON 文件的翻译部分:

{
    "name": "laravel/laravel",
    "description": "Laravel 框架。",
    "keywords": ["框架", "laravel"],
    "license": "MIT",
    "type": "项目",
    "require": {
        "php": "^8.1",
        "guzzlehttp/guzzle": "^7.2",
        "laravel/framework": "^10.0",
        "laravel/sanctum": "^3.2",
        "laravel/tinker": "^2.8",
        "laravel/ui": "^4.2",
        "laravelcollective/html": "^6.4",
        "sentry/sentry-laravel": "3.*",
        "srmklive/paypal": "~3.0",
        "stripe/stripe-php": "^7.0.0",
        "symfony/http-client": "^6.1",
        "symfony/mailgun-mailer": "^6.1",
        "symfony/postmark-mailer": "^6.1"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9.1",
        "laravel/dusk": "^7.7",
        "mockery/mockery": "^1.4.4",
        "laravel/pint": "^1.0",
        "laravel/sail": "^1.18",
        "nunomaduro/collision": "^7.0",
        "pestphp/pest": "^2.0",
        "pestphp/pest-plugin-laravel": "^2.0",
        "spatie/laravel-ignition": "^2.0"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        },
        "files": [
            "app/Helpers/Helper.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "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"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true,
        "allow-plugins": {
            "pestphp/pest-plugin": true,
            "php-http/discovery": true
        }
    }
}
英文:

I ended up comparing a little with the most current laravel composer.json file and ended up with this:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": "^8.1",
        "guzzlehttp/guzzle": "^7.2",
        "laravel/framework": "^10.0",
        "laravel/sanctum": "^3.2",
        "laravel/tinker": "^2.8",
        "laravel/ui": "^4.2",
        "laravelcollective/html": "^6.4",
        "sentry/sentry-laravel": "3.*",
        "srmklive/paypal": "~3.0",
        "stripe/stripe-php": "^7.0.0",
        "symfony/http-client": "^6.1",
        "symfony/mailgun-mailer": "^6.1",
        "symfony/postmark-mailer": "^6.1"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9.1",
        "laravel/dusk": "^7.7",
        "mockery/mockery": "^1.4.4",
        "laravel/pint": "^1.0",
        "laravel/sail": "^1.18",
        "nunomaduro/collision": "^7.0",
        "pestphp/pest": "^2.0",
        "pestphp/pest-plugin-laravel": "^2.0",
        "spatie/laravel-ignition": "^2.0"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        },
        "files": [
            "app/Helpers/Helper.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "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"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true,
        "allow-plugins": {
            "pestphp/pest-plugin": true,
            "php-http/discovery": true
        }
    }
}

huangapple
  • 本文由 发表于 2023年2月26日 21:17:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/75572247.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定