简体   繁体   中英

Can't update to Laravel 5.8 from 5.7

I am trying to upgrade my site from Laravel 5.7 to 5.8.

I changed laravel/framework in composer.json to "5.8.*" and then run composer update but the result from composer is this:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
    You can run './vendor/bin/upgrade-carbon' to get help in updating carbon and other frameworks and libraries that depend on it.
> @php artisan package:discover
Discovered Package: barryvdh/laravel-dompdf
Discovered Package: barryvdh/laravel-ide-helper
Discovered Package: fideloper/proxy
Discovered Package: laravel/nexmo-notification-channel
Discovered Package: laravel/slack-notification-channel
Discovered Package: laravel/tinker
Discovered Package: laravelcollective/html
Discovered Package: maatwebsite/excel
Discovered Package: nesbot/carbon
Discovered Package: staudenmeir/dusk-updater
Discovered Package: yajra/laravel-datatables-buttons
Discovered Package: yajra/laravel-datatables-editor
Discovered Package: yajra/laravel-datatables-fractal
Discovered Package: yajra/laravel-datatables-html
Discovered Package: yajra/laravel-datatables-oracle
Package manifest generated successfully.
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan ide-helper:generate
A new helper file was written to _ide_helper.php
> php artisan ide-helper:meta
A new meta file was written to .phpstorm.meta.php

I even tried updating the version number in the composer.lock but that didn't work either, it just reverted back the version to "5.7.28".

EDIT 1:

Tried also deleting composer.lock but got a similar result, here it is:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating optimized autoload files
Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
    You can run './vendor/bin/upgrade-carbon' to get help in updating carbon and other frameworks and libraries that depend on it.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
Discovered Package: barryvdh/laravel-dompdf
Discovered Package: barryvdh/laravel-ide-helper
Discovered Package: fideloper/proxy
Discovered Package: laravel/nexmo-notification-channel
Discovered Package: laravel/slack-notification-channel
Discovered Package: laravel/tinker
Discovered Package: laravelcollective/html
Discovered Package: maatwebsite/excel
Discovered Package: nesbot/carbon
Discovered Package: staudenmeir/dusk-updater
Discovered Package: yajra/laravel-datatables-buttons
Discovered Package: yajra/laravel-datatables-editor
Discovered Package: yajra/laravel-datatables-fractal
Discovered Package: yajra/laravel-datatables-html
Discovered Package: yajra/laravel-datatables-oracle
Package manifest generated successfully.
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan ide-helper:generate
A new helper file was written to _ide_helper.php
> php artisan ide-helper:meta
A new meta file was written to .phpstorm.meta.php

EDIT 2:

I did this:

composer require laravel/framework ^5.8

the result is:

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install laravel/framework v5.8.24
    - Conclusion: don't install laravel/framework v5.8.23
    - Conclusion: don't install laravel/framework v5.8.22
    - Conclusion: don't install laravel/framework v5.8.21
    - Conclusion: don't install laravel/framework v5.8.20
    - Conclusion: don't install laravel/framework v5.8.19
    - Conclusion: don't install laravel/framework v5.8.18
    - Conclusion: don't install laravel/framework v5.8.17
    - Conclusion: don't install laravel/framework v5.8.16
    - Conclusion: don't install laravel/framework v5.8.15
    - Conclusion: don't install laravel/framework v5.8.14
    - Conclusion: don't install laravel/framework v5.8.13
    - Conclusion: don't install laravel/framework v5.8.12
    - Conclusion: don't install laravel/framework v5.8.11
    - Conclusion: don't install laravel/framework v5.8.10
    - Conclusion: don't install laravel/framework v5.8.9
    - Conclusion: don't install laravel/framework v5.8.8
    - Conclusion: don't install laravel/framework v5.8.7
    - Conclusion: don't install laravel/framework v5.8.6
    - Conclusion: don't install laravel/framework v5.8.5
    - Conclusion: don't install laravel/framework v5.8.4
    - Conclusion: don't install laravel/framework v5.8.3
    - Conclusion: don't install laravel/framework v5.8.2
    - Conclusion: don't install laravel/framework v5.8.1
    - laravelcollective/html v5.7.1 requires illuminate/view 5.7.* -> satisfiable by laravel/framework[v5.7.28], illuminate/view[5.7.17, 5.7.18, 5.7.19, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9].
    - laravelcollective/html v5.7.1 requires illuminate/view 5.7.* -> satisfiable by laravel/framework[v5.7.28], illuminate/view[5.7.17, 5.7.18, 5.7.19, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9].
    - laravelcollective/html v5.7.1 requires illuminate/view 5.7.* -> satisfiable by laravel/framework[v5.7.28], illuminate/view[5.7.17, 5.7.18, 5.7.19, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9].
    - Can only install one of: laravel/framework[v5.8.0, v5.7.28].
    - don't install illuminate/view 5.7.17|don't install laravel/framework v5.8.0
    - don't install illuminate/view 5.7.18|don't install laravel/framework v5.8.0
    - don't install illuminate/view 5.7.19|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.0|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.1|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.10|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.11|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.15|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.2|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.20|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.21|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.22|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.23|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.26|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.27|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.28|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.3|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.4|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.5|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.6|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.7|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.8|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.7.9|don't install laravel/framework v5.8.0
    - Installation request for laravel/framework ^5.8 -> satisfiable by laravel/framework[v5.8.0, v5.8.1, v5.8.10, v5.8.11, v5.8.12, v5.8.13, v5.8.14, v5.8.15, v5.8.16, v5.8.17, v5.8.18, v5.8.19, v5.8.2, v5.8.20, v5.8.21, v5.8.22, v5.8.23, v5.8.24, v5.8.3, v5.8.4, v5.8.5, v5.8.6, v5.8.7, v5.8.8, v5.8.9].
    - Installation request for laravelcollective/html (locked at v5.7.1) -> satisfiable by laravelcollective/html[v5.7.1].


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

Any ideas?

Try using this

composer require laravel/framework ^5.8 --update-with-dependencies

--update-with-dependencies: Also update dependencies of the newly required packages, except those that are root requirements.

Or when updating a package

composer update laravel/framework --with-dependencies

--with-dependencies: Add also dependencies of whitelisted packages to the whitelist, except those that are root requirements.

In other words this will update other packages besides laravel/framework which are required for the update to Laravel 5.8.

Did you try running the ./vendor/bin/upgrade-carbon as suggested in your error message? I recently encountered a similar issue with different framework, but after upgrading Carbon to v2 I could update my framework and other packages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM