在新安装的laravel 8中安装Jetstream和livewire时遇到问题

时间:2020-10-06 08:29:35

标签: php laravel composer-php

dev

请问有人遇到过这种问题,我正在安装新的laravel 8,希望与其一起安装[jet-stream和livewire] [1],我使用以下cmd安装了laravel 8:

composer create-project --prefer-dist laravel/laravel blog

然后继续使用...安装喷射流

$ composer require laravel/jetstream

此cmd结果:


无法下载“ http://repo.packagist.org/p/provider-2019%2427b76b9f0218e7440cf8a7d3dfe11f6ac69610e72f5277d4ee2bf31e24c43772.json”文件:php_network_getaddresses:getaddrinfo失败:未知此类主机。 无法打开流:php_network_getaddresses:getaddrinfo失败:此类主机未知。 http://repo.packagist.org无法完全加载,软件包信息是从本地缓存加载的,可能已过期

[InvalidArgumentException] 版本laravel / jetstream软件包的PHP要求不兼容wi 您的PHP版本(7.2.32)

需要[--dev] [--prefer-source] [--prefer-dist] [--fixed] [--no-progress] [--no-suggest] [--no-update] [ --no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable ] [--prefer-lowest] [--sort-packages] [-o | --optimize-autoloader] [-a | --classmap-authoritative] [--apcu-autoloader] [-] []。


我跑

php -v 

这是我的php版本:


PHP 7.2.32(CLI)(内置:2020年7月8日10:38:05)(ZTS MSVC15(Visual C ++ 2017)x6 4) 版权所有(c)1997-2018 The PHP Group Zend Engine v3.2.0,版权所有(c)1998-2018 Zend Technologies


我尝试通过cm为一个作曲家更新我的PHP版本 :

$ composer config platform.php 7.4.3

并尝试运行

$ composer require laravel/jetstream

然后结果:

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

  Problem 1
    - Conclusion: remove laravel/framework v7.28.3
    - Conclusion: don't install laravel/framework v7.28.3
    - laravel/jetstream 1.x-dev requires illuminate/support ^8.0 -> satisfiable by illuminate/support[8.x-dev, v8.0.0, v8.0.1, v8.0.2, v8.0.3, v8.0.4, v8.1.0, v8.2.0, v8.3.0, v8.4.0, v8.5.0, v8.6.0, v8.7.0, v8.7.1, v8.8.0].
    - laravel/jetstream v1.3.0 requires illuminate/support ^8.0 -> satisfiable by illuminate/support[8.x-dev, v8.0.0, v8.0.1, v8.0.2, v8.0.3, v8.0.4, v8.1.0, v8.2.0, v8.3.0, v8.4.0, v8.5.0, v8.6.0, v8.7.0, v8.7.1, v8.8.0].
    - laravel/jetstream v1.3.1 requires illuminate/support ^8.0 -> satisfiable by illuminate/support[8.x-dev, v8.0.0, v8.0.1, v8.0.2, v8.0.3, v8.0.4, v8.1.0, v8.2.0, v8.3.0, v8.4.0, v8.5.0, v8.6.0, v8.7.0, v8.7.1, v8.8.0].
    - laravel/jetstream v1.3.2 requires illuminate/support ^8.0 -> satisfiable by illuminate/support[8.x-dev, v8.0.0, v8.0.1, v8.0.2, v8.0.3, v8.0.4, v8.1.0, v8.2.0, v8.3.0, v8.4.0, v8.5.0, v8.6.0, v8.7.0, v8.7.1, v8.8.0].
    - don't install illuminate/support 8.x-dev|don't install laravel/framework v7.28.3
    - don't install illuminate/support v8.0.0|don't install laravel/framework v7.28.3
    - don't install illuminate/support v8.0.1|don't install laravel/framework v7.28.3
    - don't install illuminate/support v8.0.2|don't install laravel/framework v7.28.3
    - don't install illuminate/support v8.0.3|don't install laravel/framework v7.28.3
    - don't install illuminate/support v8.0.4|don't install laravel/framework v7.28.3
    - don't install illuminate/support v8.1.0|don't install laravel/framework v7.28.3
    - don't install illuminate/support v8.2.0|don't install laravel/framework v7.28.3
    - don't install illuminate/support v8.3.0|don't install laravel/framework v7.28.3
    - don't install illuminate/support v8.4.0|don't install laravel/framework v7.28.3
    - don't install illuminate/support v8.5.0|don't install laravel/framework v7.28.3
    - don't install illuminate/support v8.6.0|don't install laravel/framework v7.28.3
    - don't install illuminate/support v8.7.0|don't install laravel/framework v7.28.3
    - don't install illuminate/support v8.7.1|don't install laravel/framework v7.28.3
    - don't install illuminate/support v8.8.0|don't install laravel/framework v7.28.3
    - Installation request for laravel/framework (locked at v7.28.3, required as ^7.24) -> satisfiable by laravel/framework[v7.28.3].
    - Installation request for laravel/jetstream ^1.3 -> satisfiable by laravel/jetstream[1.x-dev, v1.3.0, v1.3.1, v1.3.2].


Installation failed, reverting ./composer.json to its original content.

这是我的composer.json


{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.2.5",
        "fideloper/proxy": "^4.2",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^6.3",
        "laravel/framework": "^7.24",
        "laravel/tinker": "^2.0"
    },
    "require-dev": {
        "facade/ignition": "^2.0",
        "fzaninotto/faker": "^1.9.1",
        "mockery/mockery": "^1.3.1",
        "nunomaduro/collision": "^4.1",
        "phpunit/phpunit": "^8.5"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true,
        "platform": {
            "php": "7.4.3"
        }
    },
    "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"
        ]
    }
}

请问这个问题看起来很明显,我需要升级PHP版本,但是我不知道要去哪里

请指导,谢谢 [1]:https://jetstream.laravel.com/

2 个答案:

答案 0 :(得分:0)

在我看来,信息缺乏。 但... 就我而言。

composer global remove laravel / installer
composer global remove laravel / laravel **

composer global require laravel / installer

php -v
<块引用>

PHP 7.4.19 (cli) (built: May 4 2021 11:06:37) (NTS) 版权所有 (c) PHP Group Zend Engine v3.4.0, 版权所有 (c) Zend Technologies 使用 Zend OPcache v7.4.19,版权所有 (c),由 Zend Technologies 提供

那里你可以使用`

composer global config platform.php 7.4.19

使用您的 php 版本全局配置 Composer

现在。 我使用喷射流

laravel new minimarket --git -f --jet

对于这种方法,请安装干净的 laravel 8,我使用 Fedora 34 和 maria 数据库

答案 1 :(得分:-1)

嗨,请检查Laravel 8是否需要php 7.3或更高版本(您正在 问题,因为您使用的是php7.2)

请检查文档https://laravel.com/docs/8.x