Hướng dẫn nhỏ Updating to Drupal 8.5 with composer

Hướng dẫn nhỏ Updating to Drupal 8.5 with composer

If you are like me, you might have already started planning the upgrade to Drupal 8.5, now that the first release candidate is out. It's awesome by the way, among other things, thanks to the incredible work done with layout builder. And if you are more like me, you are managing your sites with composer. Then, depending on the rest of your project, you might (also like me), have encountered some initial problems upgrading to Drupal 8.5

Having hit my fair share of composer oddities with running the Violinist.io composer monitor and upgrade service, I wanted to compile a couple of error messages along with solutions, to the folks struggling with this out there.

Installation request for webflo/drupal-core-require-dev (locked at 8.4.5, required as ~8.4) -> satisfiable by webflo/drupal-core-require-dev[8.4.5].

If you have installed an out of the box version of https://github.com/drupal-composer/drupal-project, this might be an error message you encounter. Full error message, for reference:

./composer.json has been updated
> DrupalProject\composer\ScriptHandler::checkComposerVersion
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

    - webflo/drupal-core-require-dev 8.4.5 requires drupal/core 8.4.5 -> satisfiable by drupal/core[8.4.5] but these conflict with your requirements or minimum-stability.
    - webflo/drupal-core-require-dev 8.4.5 requires drupal/core 8.4.5 -> satisfiable by drupal/core[8.4.5] but these conflict with your requirements or minimum-stability.
    - webflo/drupal-core-require-dev 8.4.5 requires drupal/core 8.4.5 -> satisfiable by drupal/core[8.4.5] but these conflict with your requirements or minimum-stability.
    - Installation request for webflo/drupal-core-require-dev (locked at 8.4.5, required as ~8.4) -> satisfiable by webflo/drupal-core-require-dev[8.4.5].

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

The reason this fails is that the project you have created is depending on the dev packages for drupal core, which are tied to a specific version of core. So to update core, we also need to update the dev packages for core.

The solution to this is pretty simple:

Open your composer.json file and replace the lines for drupal/core and webflo/drupal-core-require-dev with the following:

"drupal/core": "~8.5"
// ...and
"webflo/drupal-core-require-dev": "~8.5"

Afterwards you can go ahead and run:

composer update drupal/core webflo/drupal-core-require-dev --with-dependencies

Edit: balsama pointed out in the comments that you can also run the command composer require drupal/core:~8.5.0 webflo/drupal-core-require-dev:~8.5.0 --no-update. However. This would move the package webflo/drupal-core-require-dev to "require" instead of "require-dev", which is probably not what you want. You could of course do a similar thing in 2 commands (one for require and one for require-dev), which would yield a similar result as updating by hand.

Installation request for symfony/config (locked at v3.2.14) -> satisfiable by symfony/config[v3.2.14].

This probably comes from the fact that you also have some other packages depending on this specific Symfony package in your project. Like drush or drupal console. This would not be a problem in itself, were it not for the fact that drupal/core 8.5 relies on the package symfony/dependency-injection that has specifically listed "symfony/config": "<3.3.7", as a conflict. Here is a full error message, for reference:

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 drupal/core 8.5.0-rc1
    - Conclusion: don't install drupal/core 8.5.0-beta1
    - Conclusion: don't install drupal/core 8.5.0-alpha1
    - Conclusion: don't install drupal/core 8.6.x-dev
    - Conclusion: remove symfony/config v3.2.14
    - Installation request for drupal/core ~8.5 -> satisfiable by drupal/core[8.5.0-alpha1, 8.5.0-beta1, 8.5.0-rc1, 8.5.x-dev, 8.6.x-dev].
    - Conclusion: don't install symfony/config v3.2.14
    - drupal/core 8.5.x-dev requires symfony/dependency-injection ~3.4.0 -> satisfiable by symfony/dependency-injection[3.4.x-dev, v3.4.0, v3.4.0-BETA1, v3.4.0-BETA2, v3.4.0-BETA3, v3.4.0-BETA4, v3.4.0-RC1, v3.4.0-RC2, v3.4.1, v3.4.2, v3.4.3, v3.4.4].
    - symfony/dependency-injection 3.4.x-dev conflicts with symfony/config[v3.2.14].
    - symfony/dependency-injection v3.4.0 conflicts with symfony/config[v3.2.14].
    - symfony/dependency-injection v3.4.0-BETA1 conflicts with symfony/config[v3.2.14].
    - symfony/dependency-injection v3.4.0-BETA2 conflicts with symfony/config[v3.2.14].
    - symfony/dependency-injection v3.4.0-BETA3 conflicts with symfony/config[v3.2.14].
    - symfony/dependency-injection v3.4.0-BETA4 conflicts with symfony/config[v3.2.14].
    - symfony/dependency-injection v3.4.0-RC1 conflicts with symfony/config[v3.2.14].
    - symfony/dependency-injection v3.4.0-RC2 conflicts with symfony/config[v3.2.14].
    - symfony/dependency-injection v3.4.1 conflicts with symfony/config[v3.2.14].
    - symfony/dependency-injection v3.4.2 conflicts with symfony/config[v3.2.14].
    - symfony/dependency-injection v3.4.3 conflicts with symfony/config[v3.2.14].
    - symfony/dependency-injection v3.4.4 conflicts with symfony/config[v3.2.14].
    - Installation request for symfony/config (locked at v3.2.14) -> satisfiable by symfony/config[v3.2.14].

The solution here is to indicate you also want to update this package, even if it's not specifically required. So if the failing command was the following:

composer update drupal/core --with-dependencies

Go ahead and change it to this:

composer update drupal/core symfony/config --with-dependencies

Edit: To clarify based on a comment from balsama: It does not help to add the flag --with-all-dependencies here, since it is not related to a "sibling" dependency, or a nested dependency of the packages to be updated.

If you have other error messages, I would be glad to help out with a solution, and post the result here.

Bạn thấy bài viết này như thế nào?: 
Average: 5 (1 vote)
Ảnh của Tommy Tran

Tommy owner Express Magazine

Drupal Developer having 9+ year experience, implementation and having strong knowledge of technical specifications, workflow development. Ability to perform effectively and efficiently in team and individually. Always enthusiastic and interseted to study new technologies

  • Skype ID: tthanhthuy

Bình luận (0)

 

Add Comment

Filtered HTML

  • Các địa chỉ web và email sẽ tự động được chuyển sang dạng liên kết.
  • Các thẻ HTML được chấp nhận: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Tự động ngắt dòng và đoạn văn.

Plain text

  • No HTML tags allowed.
  • Các địa chỉ web và email sẽ tự động được chuyển sang dạng liên kết.
  • Tự động ngắt dòng và đoạn văn.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

Tìm kiếm bất động sản

 

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Những ứng dụng hữu ích cho Facebook Page

Những ứng dụng hữu ích cho Facebook Page

Có một trang Facebook Page với hàng ngàn người like. Bạn đã bao giờ nghĩ đến việc "cải tổ" trang Facebook Page của mình cho nó có "một vẻ bề ngoài" chuyên nghiệp hơn không?

MacBook Pro Retina 13 inch sẽ được phát hành trong tháng Chín

MacBook Pro Retina 13 inch sẽ được phát hành trong tháng Chín

Theo chuyên gia phân tích Ming-Chi Kuo của KGI Securities dự đoán, một phiên bản mới của MacBook Pro Retina với màn hình 13 inch sẽ được Apple giới thiệu ra thị trường vào tháng 9 tới đây.

Thị trường bất động sản 2019 có thể xảy ra tình trạng tăng giá đất nền tại một số khu vực

Thị trường bất động sản 2019 có thể xảy ra tình trạng tăng giá đất nền tại một số khu vực

Dòng vốn ngoại tiếp tục đổ bộ, nhu cầu nhà ở của người dân còn lớn… là những yếu tố sẽ tạo nên gam màu sáng cho thị trường bất động sản năm 2019. Tuy nhiên, thị trường vẫn còn nhiều thách thức

Công ty diệt chuột T&C

 

Diet con trung