通过Composer提取silverstripe / upgradeer的zip文件时出错

时间:2019-06-10 07:35:04

标签: composer-php silverstripe

我正在将SilverStripe 3.6.5实例升级到SS 4.x,并且一直遵循建议安装SilverStripe upgrader

但是在Windows开发盒上运行composer global require silverstripe/upgrader会产生以下结果:

Using version ^1.4 for silverstripe/upgrader
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing silverstripe/upgrader (1.4.1): Downloading (100%)
    Failed to download silverstripe/upgrader from dist: There was an error extracting the ZIP file, it is either corrupted or using an invalid format.
    Now trying to download from source
  - Installing silverstripe/upgrader (1.4.1): Cloning 84226286c8 from cache

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

我正在使用此堆栈:

  • Windows 8.1
  • PHP 7.1.26
  • 作曲者1.8.5
  • git版本2.21.0.windows.1

目前,我在全局范围内没有Composer软件包。

我也曾尝试(无济于事)是卸载composer,清除所有缓存和文件夹,然后重新开始,再次下载Composer-Setup.exe,并在安装完成后立即尝试composer global require silverstripe/upgrader在命令行上。结果与Silverstripe / upgradeer相同,尽管下载并安装了所有其他软件包(我猜是依赖)。例如,这是重新启动后的命令行输出摘录:

Changed current directory to C:/Users/Amenel/AppData/Roaming/Composer
Using version ^1.4 for silverstripe/upgrader
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 35 installs, 0 updates, 0 removals
  - Installing ocramius/package-versions (1.4.0): Downloading (100%)
  - Installing composer/ca-bundle (1.1.4): Downloading (100%)
  - Installing padraic/humbug_get_contents (1.1.2): Downloading (100%)
  - Installing padraic/phar-updater (v1.0.6): Downloading (100%)
  - Installing symfony/polyfill-ctype (v1.11.0): Downloading (100%)
  - Installing symfony/filesystem (v4.3.1): Downloading (100%)
...

当我对其进行网络搜索时,似乎找不到与该特定错误相关的任何东西。

还应注意:当我指定Silverstripe /升级程序的先前版本时,也会报告此错误。 1.3.0。

总而言之,我的问题是我无法启动升级过程,因为通过composer安装升级程序失败。

1 个答案:

答案 0 :(得分:0)

这就是我规避此问题的方式。

我的目标是运行升级程序。如文档所述,该路径是在Windows上使用Composer。但是通过Composer的路径似乎被阻塞。我问自己有什么选择。在虚拟机中重新安装整个堆栈是可能的,但很麻烦。我一直在想,但没有什么吸引人的。

我最终将phar文件下载到D:\Programs\SilverStripe-upgrader,并将其重命名为upgrade-code-1.4.1.phar。鉴于D:\Programs环境中已经包含PATH,我创建了一个文件D:\Programs\upgrade-code.bat,其内容如下:

@ECHO OFF
php %~dp0\SilverStripe-upgrader\upgrade-code-1.4.1.phar %*

我还没有运行迁移,但是upgrade-code help工作正常。 HTH。