laravel Jetstream安装失败:无法解析为可安装的软件包集

s2j5cfk0  于 2023-01-06  发布在  其他
关注(0)|答案(4)|浏览(233)

安装Laravel Jetstream时出现此错误:

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

  Problem 1
    - laravel/jetstream[v2.3.0, ..., 2.x-dev] require league/commonmark ^1.3 -> found league/commonmark[1.3.0, ..., 1.6.x-dev] but the package is fixed to 2.0.0 (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 ^2.3 -> satisfiable by laravel/jetstream[v2.3.0, ..., 2.x-dev].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

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

这是全新安装的Laravel框架8.51.0

ddhy6vgd

ddhy6vgd1#

我试了这些答案,但对我不起作用,所以我试了这个。
首先,应在新的Laravel应用程序中安装Jetstream(请阅读Jetstream laravel的此文档:https://jetstream.laravel.com/2.x/installation.html)。第一步:
1.安装新的laravel项目版本8

  1. composer require laravel/jetstream:*,这样就完成了继续安装jetstream
kmpatx3s

kmpatx3s2#

Laravel 8文档不清晰。您可以通过以下命令修复它:

php artisan jetstream:install livewire

npm install && npm run dev
pdsfdshx

pdsfdshx3#

此命令:

composer require laravel/jetstream

也生成了与您为我生成的错误相同的错误,但另一个命令工作正常:

composer require laravel/jetstream:*
xkrw2x1b

xkrw2x1b4#

我尝试安装新鲜的laravel(具体的laravel项目像这样):

composer create-project --prefer-dist laravel/laravel:^8.0 olshop-larafel

然后进入这个项目

cd olshop-larafel

安装laravel/jetstream:

composer require laravel/jetstream

一切正常。你试过安装laravel 8.0特定版本吗?
或者这个article will help you
这是我的composer.json文件:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.3",
        "fideloper/proxy": "^4.2",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "laravel/framework": "^8.0",
        "laravel/jetstream": "^2.3",
        "laravel/tinker": "^2.0"
    },
    "require-dev": {
        "facade/ignition": "^2.3.6",
        "fzaninotto/faker": "^1.9.1",
        "mockery/mockery": "^1.3.1",
        "nunomaduro/collision": "^5.0",
        "phpunit/phpunit": "^9.3"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "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"
        ]
    }
}

相关问题