علیرضا مه آبادی
2 سال پیش توسط علیرضا مه آبادی مطرح شد
4 پاسخ

باگ هنگام انتقال پروژه لاراولی 8 به 9

عرض ادب بنده کم تجربه ام و دارم لاراول 8 به 9 بروزرسانی می کنم و طبق مستندات پیش رفتم اما خطای پکیج اسلاگبل میده واقعا گیج شدم
نمی دونم اینکیج که ورژن 9 هم اومده بروز رسانی کنم.؟
اینم خطای مربوطه

PS C:\Users\aseman\Desktop\AryaBMS> composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - cviebrock/eloquent-sluggable[8.0.0, ..., 8.0.1] require php ^7.3 -> your php version (8.1.4) does not satisfy that requirement.
    - illuminate/config[v8.0.0, ..., v8.11.2] require php ^7.3 -> your php version (8.1.4) does not satisfy that requirement.
    - Only one of these can be installed: illuminate/config[v5.8.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev, v9.0.0-beta.1
, ..., 9.x-dev], laravel/framework[v9.0.0-beta.1, ..., 9.x-dev]. laravel/framework replaces illuminate/config and thus cannot coexist with it.
    - cviebrock/eloquent-sluggable[8.0.2, ..., 8.0.8] require illuminate/config ^8.0 -> satisfiable by illuminate/config[v8.0.0, ..., 8.x-dev].
    - Root composer.json requires cviebrock/eloquent-sluggable ^8.0 -> satisfiable by cviebrock/eloquent-sluggable[8.0.0, ..., 8.0.8].
    - Root composer.json requires laravel/framework ^9.0 -> satisfiable by laravel/framework[v9.0.0-beta.1, ..., 9.x-dev].

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

اینم بخشی از composer.json که تغییر دادم

 "laravel/framework": "^9.0",
 "spatie/laravel-ignition": "^1.0",
 "nunomaduro/collision": "^6.1",
"php": "^8.0.2",

به این پکیج گیر میده

 "cviebrock/eloquent-sluggable": "^8.0",

ممنون میشم راهنماییم کنید تشکر


ثبت پرسش جدید
محمدحسن یگانه
تخصص : Full-Stack Web Developer Freel...
@mhyeganeh 2 سال پیش آپدیت شد
0

سلام. پاسختون در مستندات رسمی پکیجی که اسم بردید اومده:
 تصویر

خط زیر رو بروزرسانی کنید و سپس مجددا composer update رو اجرا کنید:

 "cviebrock/eloquent-sluggable": "^9.0",

علیرضا مه آبادی
تخصص : در حال یادگیری لاراول
@aliasgharkashani1379 2 سال پیش مطرح شد
0

@mhyeganeh مهندس جان این کارم کرده بودم دوباره هم طبق دستور شما انجام دادم و این ارور میده!!

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

  Problem 1                                                                                
    - Conclusion: don't install laravel/framework v9.0.0-beta.1 (conflict analysis result) 
    - Conclusion: don't install laravel/framework v9.0.0-beta.2 (conflict analysis result) 
    - Conclusion: don't install laravel/framework v9.0.0-beta.3 (conflict analysis result) 
    - Conclusion: don't install laravel/framework v9.0.0-beta.4 (conflict analysis result) 
    - Conclusion: don't install laravel/framework v9.0.0-beta.5 (conflict analysis result) 
    - Conclusion: don't install laravel/framework v9.0.0 (conflict analysis result)        
    - Conclusion: don't install laravel/framework v9.0.1 (conflict analysis result)        
    - Conclusion: don't install laravel/framework v9.0.2 (conflict analysis result)        
    - Conclusion: don't install laravel/framework v9.1.0 (conflict analysis result)        
    - Conclusion: don't install laravel/framework v9.2.0 (conflict analysis result)        
    - Conclusion: don't install laravel/framework v9.3.0 (conflict analysis result)        
    - Conclusion: don't install laravel/framework v9.3.1 (conflict analysis result)        
    - Conclusion: don't install laravel/framework v9.4.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.4.1 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.5.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.5.1 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.6.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.7.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.8.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.8.1 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.9.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.10.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.10.1 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.11.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.12.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.13.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.14.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.14.1 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.15.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.16.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.17.0 (conflict analysis result)
    - illuminate/support[v5.6.0, ..., 5.8.x-dev] require php ^7.1.3 -> your php version (8.1.4) does not satisfy that requirement.
    - illuminate/support[v6.0.0, ..., v6.19.1] require php ^7.2 -> your php version (8.1.4) does not satisfy that requirement.
    - illuminate/support[v7.0.0, ..., v7.28.4] require php ^7.2.5 -> your php version (8.1.4) does not satisfy that requirement.
    - illuminate/support[v8.0.0, ..., v8.11.2] require php ^7.3 -> your php version (8.1.4) does not satisfy that requirement.
    - uxweb/sweet-alert 2.0.5 requires illuminate/support ~5.0|^6.0|^7.0|^8.0 -> satisfiable by illuminate/support[v5.0.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7
.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev].
    - uxweb/sweet-alert[2.0.2, ..., v2.0.3] require illuminate/support ~5.0|^6.0|^7.0 -> satisfiable by illuminate/support[v5.0.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x
-dev, v7.0.0, ..., 7.x-dev].
    - uxweb/sweet-alert[2.0.0, ..., v2.x-dev] require illuminate/support ~5.0 -> satisfiable by illuminate/support[v5.0.0, ..., 5.8.x-dev].
    - Only one of these can be installed: illuminate/support[v5.0.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev, v9.0.0-beta.
1, ..., 9.x-dev], laravel/framework[v9.0.0-beta.1, ..., 9.x-dev]. laravel/framework replaces illuminate/support and thus cannot coexist with it.
    - Root composer.json requires laravel/framework ^9.0 -> satisfiable by laravel/framework[v9.0.0-beta.1, ..., 9.x-dev].
    - Root composer.json requires uxweb/sweet-alert ^2.0 -> satisfiable by uxweb/sweet-alert[2.0.0, ..., v2.x-dev].

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

علیرضا مه آبادی
تخصص : در حال یادگیری لاراول
@aliasgharkashani1379 2 سال پیش مطرح شد
0

@mhyeganeh اینم تمام کد داخل composer.json من هست.

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "php": "^8.0.2",
        "artesaos/seotools": "^0.22.0",
        "biscolab/laravel-recaptcha": "^5.4",
        "cviebrock/eloquent-sluggable": "^9.0",
        "cyrildewit/eloquent-viewable": "^6.0",
        "fruitcake/laravel-cors": "^2.0",
        "ghasedak/php": "dev-master",
        "guzzlehttp/guzzle": "^7.0.1",
        "laravel/fortify": "^1.8",
        "laravel/framework": "^9.0",
        "laravel/sanctum": "^2.11",
        "laravel/tinker": "^2.5",
        "livewire/livewire": "^2.10",
        "morilog/jalali": "3.*",
        "select2/select2": "^4.0",
        "uxweb/sweet-alert": "^2.0"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.6",
        "spatie/laravel-ignition": "^1.0",
        "fakerphp/faker": "^1.9.1",
        "laravel/sail": "^1.0.1",
        "mockery/mockery": "^1.4.2",
        "nunomaduro/collision": "^6.1",
        "phpunit/phpunit": "^9.3.3"
    },
    "autoload": {
        "files": [
            "app/Http/Helpers/active.php",
            "app/Http/Helpers/LikeAndFollow.php"
        ],
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/",
            "Modules\\": "Modules/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

محمدحسن یگانه
تخصص : Full-Stack Web Developer Freel...
@mhyeganeh 2 سال پیش آپدیت شد
0

وقتی در چنین شرایطی می‌بینید که متن ارور تغییر پیدا می‌کنه، جای خوشحالی داره و معناش معمولا اینه که یک مرحله جلوتر رفتیم.

حالا هم اگر در ارورهای جدید دقت کنید، می‌بینید که داره از پکیج uxweb/sweetalert ایراد می گیره که با سایر وابستگی ها همخونی نداره. علتش هم اینکه که این پکیج هنوز از لاراول نسخه ۹ پشتیبانی نمی‌کنه و اینجا هم به این قضیه اشاره شده:
https://github.com/uxweb/sweet-alert/issues/137

عملا کار خاصی نمی‌تونید در این شرایط انجام بدید.جز اینکه تا زمان پشتیبانی همه وابستگی هاتون از لاراول ۹ بروزرسانی رو به تاخیر بیاندازید. ولی پیشنهاد اصلی من این هست که قید پکیج هایی که تا این حد از قافله عقب هستند رو کلا بزنید. چون به احتمال زیاد در آینده هم زیاد مسئله زا خواهند بود.

ضمن اینکه واقعا برای نمایش دادن SweetAlert نیازی به پکیج کامپوزر نیست به نظرم و خودتون خیلی راحت با استفاده از flash session و تعریف یک helper function می ‌تونید به راحتی انجامش بدید و پکیج رو کلا حذف کنید.


برای ارسال پاسخ لازم است وارد شده یا ثبت‌نام کنید

ورود یا ثبت‌نام