标题的内容也是手贱导致的,本来composer不self-update也不会出现这个问题,这不,一升到最新的composer就出问题了
1、由于我们为了追求速度,大部分都是用的国内的源,这些源往往都不是https的,这回好了,出错了。
Your configuration does not allow connection to http://packagist.phpcomposer.com. See https://getcomposer.org/doc/06-config.md#secure-http for details.
http://packagist.phpcomposer.com could not be fully loaded, package information was loaded from the local cache and may be out of date
OK,打开https://getcomposer.org/doc/06-config.md#secure-http查看了一下,在composer.json和~/.composer/config.json中的config节点下,增加:"secure-http":false
2、composer update的时候报:
Installation failed, reverting ./composer.json to its original content.
OK,现在可以用composer diag来检查 一下了,结果 发现:
composer diag
Checking composer.json: FAIL
No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
require.yiisoft/yii2 : unbound version constraints (*) should be avoided
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com oauth access: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: ???? 已隐藏
Dev Public Key Fingerprint: ????? 已隐藏
OK
Checking composer version: FAIL
You are not running the latest stable version, run `composer self-update` to update (e8b1a5f35772e39ca21ab855a278bd84a0a534b2 => 1.0.0-beta2)
居然显示 ,composer中一定要有license节点,require的也需要带 版本号了。于是一一加上,然后接着composer update
3、出现如标题一般的错误
处理方法:一般出现这种错误 ,大部分情况下是fxp插件需要更新了,执行composer global require fxp/composer-asset-plugin --prefer-dist,
Changed current directory to /Users/gouki/.composer
Using version ^1.1 for fxp/composer-asset-plugin
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing fxp/composer-asset-plugin (v1.1.1)
- Installing fxp/composer-asset-plugin (v1.1.2)
Downloading: 100%
Writing lock file
Generating autoload files
更新完后,再composer udpate就OK了!当然如果还有问题,你应该查看官网的issue,比如:https://github.com/francoispluchino/composer-asset-plugin/issues/191,刚开始的时候确实是BUG,后面更新了就好了。哈哈

评论 (0)
暂无评论