首页 > 解决方案 > Drupal 8 - 无法通过作曲家升级到最新版本

问题描述

我当前的 Drupal 版本:8.7.8。想升级到8.8.0。

我已经跑了

composer update
composer prohibits drupal/core:8.8.0

drupal/core    8.8.0  requires          typo3/phar-stream-wrapper (^3.1.3)              
drupal/drupal  -      requires          typo3/phar-stream-wrapper (^2.1.1)              
drupal/core    8.8.0  requires          doctrine/annotations (^1.4)                     
drupal/drupal  -      does not require  doctrine/annotations (but v1.2.7 is installed)  

所以我跑

composer update drupal/core typo/* doctrine/* --with-dependencies

它给

Package "drupal/core" listed for update is not installed. Ignoring.
Package "typo/*" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)

The "http://repo.packagist.org/p/sdboyer/gliph%24a386760768df0346abad1d5c7e9e8dcf3eba1dd5aaa86a30ddc548504b0fffa0.json" file could not be downloaded: failed to open stream: Operation timed out
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info


  [Composer\Downloader\TransportException]                                                                                                                                              
  The "http://repo.packagist.org/p/sdboyer/gliph%24a386760768df0346abad1d5c7e9e8dcf3eba1dd5aaa86a30ddc548504b0fffa0.json" file could not be downloaded: php_network_getaddresses: geta  
  ddrinfo failed: nodename nor servname provided, or not known                                                                                                                          
  failed to open stream: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known  

composer outdated drupal/*

它给

drupal/admin_toolbar 1.27.0 2.0.0 Provides a drop-down menu interface to the core Drupal Toolbar.

所以我尝试了

composer update "drupal/admin_toolbar:^2.0"
Package "drupal/admin_toolbar:^2.0" listed for update is not installed. Ignoring.
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
    - The requested package drupal/admin_toolbar (locked at 1.27.0, required as ^2.0) is satisfiable by drupal/admin_toolbar[1.27.0] but these conflict with your requirements or minimum-stability.

我还删除了composer.lock文件vendor夹并运行composer clearcachethencomposer install命令。

我不确定是什么导致问题升级。

标签: phpdrupalcomposer-php

解决方案


查看您composer.json设置了哪些基本要求。
我认为您有一些非常具体的版本,范围会有所帮助。

从命令行或 json 中显式设置新版本(范围)(当然保存旧文件)。在文件中设置/更新多个版本比通过命令行更容易。

--with-dependencies此外,使用该选项在一次运行中更新多个包也可能会有所帮助。

然后你会得到帮助,
composer update --dry-run它会告诉你会发生什么,以及
composer why-not <packet>[:<version>]为什么不能安装一个数据包(在版本中)。


推荐阅读