无法从 dist 下载 symfony/finder:解压 ZIP 文件时出错。损坏的文件?

Posted

技术标签:

【中文标题】无法从 dist 下载 symfony/finder:解压 ZIP 文件时出错。损坏的文件?【英文标题】:Failed to download symfony/finder from dist: There was an error extracting the ZIP file. Corrupt file? 【发布时间】:2014-11-16 23:33:44 【问题描述】:

我正在尝试将 Laravel 4.1 项目克隆到 Vagrant 1.6.3 虚拟机上,但是当我尝试通过运行 composer install 安装 composer 依赖项时,我得到以下信息:

  - Installing symfony/finder (2.4.x-dev 4a15fc1)
    Downloading: 100%
Failed to download symfony/finder from dist: There was an error extracting the Z
IP file. Corrupt file?
Now trying to download from source
  - Installing symfony/finder (2.4.x-dev 4a15fc1)
    Cloning 4a15fc12b56ca06d3a6bf32ef8f603ccb421d846



  [RuntimeException]

  Failed to execute git checkout "4a15fc12b56ca06d3a6bf32ef8f603ccb421d846" && g
it reset --hard "4a15fc12b56ca06d3a6bf32ef8f603ccb421d846"
  error: The following untracked working tree files would be overwritten by chec
kout:
        .gitignore

        Adapter/AbstractAdapter.php

        Adapter/AbstractFindAdapter.php

        Adapter/AdapterInterface.php

        Adapter/BsdFindAdapter.php

        Adapter/GnuFindAdapter.php

        Adapter/PhpAdapter.php

        CHANGELOG.md

        Comparator/Comparator.php

        Comparator/DateComparator.php

        Comparator/NumberComparator.php

        Exception/AccessDeniedException.php

        Exception/AdapterFailureException.php

        Exception/ExceptionInterface.php

        Exception/OperationNotPermitedException.php

        Exception/ShellCommandFailureException.php

        Expression/Expression.php

        Expression/Glob.php

        Expression/Regex.php

        Expression/ValueInterface.php

        Finder.php

        Glob.php

        Iterator/CustomFilterIterator.php

        Iterator/DateRangeFilterIterator.php

        Iterator/DepthRangeFilterIterator.php

        Iterator/ExcludeDirectoryFilterIterator.php

        Iterator/FilePathsIterator.php

        Iterator/FileTypeFilterIterator.php

        Iterator/FilecontentFilterIterator.php

        Iterator/FilenameFilterIterator.php

        Iterator/FilterIterator.php

        Iterator/MultiplePcreFilterIterator.php

        Iterator/PathFilterIterator.php

        Iterator/RecursiveDirectoryIterator.php

        Iterator/SizeRangeFilterIterator.php

        Iterator/SortableIterator.php

        LICENSE

        README.md

        Shell/Command.php

        Shell/Shell.php

        SplFileInfo.php

        Tests/Comparator/ComparatorTest.php

        Tests/Comparator/DateComparatorTest.php

        Tests/Comparator/NumberComparatorTest.php

        Tests/Expression/ExpressionTest.php

        Tests/Expression/GlobTest.php

        Tests/Expression/RegexTest.php

        Tests/FakeAdapter/DummyAdapter.php

        Tests/FakeAdapter/FailingAdapter.php

        Tests/FakeAdapter/NamedAdapter.php

        Tests/FakeAdapter/UnsupportedAdapter.php

        Tests/FinderTest.php

        Tests/Fixtures/A/B/C/abc.dat

        Tests/Fixtures/A/B/ab.dat

        Tests/Fixtures/A/a.dat

        Tests/Fixtures/copy/A/B/C/abc.dat.copy

        Tests/Fixtures/copy/A/B/ab.dat.copy

        Tests/Fixtures/copy/A/a.dat.copy

        Tests/Fixtures/dolor.txt

        Tests/Fixtures/ipsum.txt

        Tests/Fixtures/lorem.txt

        Tests/Fixtures/one/a

        Tests/Fixtures/one/b/c.neon

        Tests/Fixtures/one/b/d.neon

  Please move or remove them before you can switch branches.

  Aborting



install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-p
lugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--ver
bose] [-o|--optimize-autoloader] [packages1] ... [packagesN]

我尝试了一些随机的东西,比如清除我的 .gitignore 文件并删除 vendor/syfony/Finder 目录(它似乎失败了),但没有运气。这可能是什么原因造成的,我该如何解决?

【问题讨论】:

【参考方案1】:

这是今天为 Windows 用户引入的错误(Windows 上的 Vagrant 也是如此)。我报告了它并修复了:https://github.com/symfony/symfony/issues/11984。

提交了一个文件 一个名为 r+e.g?e*x[c]a(r)s 的文件夹,其中包含许多在 NTFS 文件系统上无效的字符(特别是 * 和 ?)。在恢复之前,该包以及任何需要它作为依赖项的包都会被破坏。

PR 已合并,现在应该已修复。

【讨论】:

以上是关于无法从 dist 下载 symfony/finder:解压 ZIP 文件时出错。损坏的文件?的主要内容,如果未能解决你的问题,请参考以下文章

使用 yarn + webpack 从 fork 安装 npm 包 - 无法解析 './dist/

Vue 组件库 - 无法从 dist 导入

从 dist 下载 laravel/spark-aurelius 失败:“https://api.github.com/repos/laravel/spark-aurelius/zipball

解决pdf.js无法完全显示pdf文件内容的问题

无法将 reactjs 和 .net 4.8 后端部署到 iis - dist 文件夹丢失

“ImportError:无法从 PyQt5 导入名称 QtCore”或任何其他模块 [重复]