问题描述
我在vagrantbox(Centos 7)上运行的作曲家遇到问题,这种情况开始突然发生。
I've an issue with composer running on a vagrantbox (Centos 7), which started to just suddenly happen.
我已经尝试过手动运行命令/解决方案在下面的链接中提及,但无济于事。
I've already tried manually running the command/solution mentioned on the link below but to no avail.
(为了澄清, 我正在使用无业游民而不是码头工人 ,但这是我所遇到的最接近的问题。我发现的大多数信息都与composer.json无效有关,但这里是packagist.org/packages.json,目前有效)
(To clarify, i'm using vagrant not docker, but it was the closest question i found to my situation. Most of the information i found are related to composer.json not being valid, but here is packagist.org/packages.json which, is currently valid)
以下是问题的详细信息。
Here are the details of the issue.
在终端机上运行 composer更新
时,我得到:
While running composer update
on terminal i get:
composer update
[Seld\JsonLint\ParsingException]
"https://repo.packagist.org/packages.json" does not contain valid JSON
Parse error on line 1:
^
Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
并且在运行还在终端上的composer install
每个软件包都返回以下内容:
And when running composer install
also on terminal every package returns this:
Failed to download psr/cache from dist: "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8"
appears broken, and returned an empty 200 response
Now trying to download from source
运行 composer config --global repo.packagist作曲家packagist.org
现在是结果
When running composer config --global repo.packagist composer packagist.org
the results are now
composer update
Loading composer repositories with package information
[Composer\Downloader\TransportException]
Your configuration does not allow connections to http://repo.packagist.org/packages.json. See https://getcomposer.o
rg/doc/06-config.md#secure-http for details.
任何想法为什么会开始发生,我该如何解决?
Any ideas why this started to happen, how can i fix it?
推荐答案
此处存在相同的问题,因为php更新至7.2.17。
在具有php 7.2.16的composer的centos 7上运行得很好...
现在回滚到7.2.16是找到的唯一解决方案...
same problem here, since php updated to 7.2.17.On a centos 7 with php 7.2.16 composer run just fine...Rollback to 7.2.16 is for now the only solution found...
编辑:
似乎是symfony flex问题:
这篇关于如何修复“ https://repo.packagist.org/packages.json不包含有效的Json”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!