php 许多包的composer校验和验证失败

vnzz0bqm  于 2023-03-21  发布在  PHP
关注(0)|答案(2)|浏览(149)

一段时间以来,composer偶尔会抱怨某些软件包的校验和验证失败。它会继续从源代码安装它们。
通常这不是问题,但我想知道是否有什么奇怪的事情发生。
示例:
- Installing doctrine/data-fixtures (v1.2.2): Downloading (100%) Failed to download doctrine/data-fixtures from dist: The checksum verification of the file failed (downloaded from https://api.github.com/repos/doctrine/data-fixtures/zipball/17fa5bfe6ff52e35cb3d9ec37c934a2f4bd1fa2e) Now trying to download from source
- Installing ocramius/proxy-manager (1.0.2): Downloading (100%) Failed to download ocramius/proxy-manager from dist: The checksum verification of the file failed (downloaded from https://api.github.com/repos/Ocramius/ProxyManager/zipball/57e9272ec0e8deccf09421596e0e2252df440e11) Now trying to download from source
- Installing doctrine/migrations (v1.5.0): Downloading (100%) Failed to download doctrine/migrations from dist: The checksum verification of the file failed (downloaded from https://api.github.com/repos/doctrine/migrations/zipball/c81147c0f2938a6566594455367e095150547f72) Now trying to download from source
- Installing doctrine/orm (v2.5.6): Downloading (100%) Failed to download doctrine/orm from dist: The checksum verification of the file failed (downloaded from https://api.github.com/repos/doctrine/doctrine2/zipball/e6c434196c8ef058239aaa0724b4aadb0107940b) Now trying to download from source
这是从我本地机器上的一个composer install调用中获取的。然而,许多包安装得很好。
在我们的Jenkins服务器上,据我所知,所有软件包都会发生这种情况。
这是怎么回事?我们确实有一个萨蒂斯服务在我们的本地网络中运行,但似乎composer抱怨来自原始包位置的dist文件。SATIS服务仅用于私有包。
有谁能想象出是什么问题吗?有谁经历过类似的问题吗?
谢谢!

igetnqfo

igetnqfo1#

尝试检查/更新composer版本,然后运行composer clear-cache

s1ag04yj

s1ag04yj2#

不是100%相关,但可能有一天会帮助别人。
我正在手动修改composer.lock文件(哦,恐怖!!!我知道,不好的做法,但有一个bug迫使我这么做)。我不得不将url更改为一个包,而以前的条目下有一个shasum条目,我没有删除。新条目不需要/有这个条目。Composer正在查看那个shasum,并注意到它不是“t a match.
所以我删除了shasum,一切都很好。

之前

"dist": {
    "type": "zip",
    "url": "https://example.com/repo/path/package-1.0.0.zip",
    "shasum": "abcdefg123456789"
},

After with error

"dist": {
    "type": "zip",
    "url": "https://repo.example.com/repo/path/package-1.0.1.zip",
    "shasum": "abcdefg123456789"
},

After没有错误

"dist": {
    "type": "zip",
    "url": "https://repo.example.com/repo/path/package-1.0.1.zip"
},

相关问题