Fecmall 升级 composer update报错:[Composer\Downloader\TransportException] Content-Length mismatch, received 81664 bytes out of the expected 5694137

bug问题 · Fecmall · 于 3年前 发布 · 1876 次阅读

Fecmall 升级 composer update报错:[Composer\Downloader\TransportException] Content-Length mismatch, received 81664 bytes out of the expected 5694137

我的安装场景:

最近一次新安装的fecmall,想要安装 yiisoft/yii2-mongodb,执行命令

composer require --prefer-dist yiisoft/yii2-mongodb

总是报错:

composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)





                                                                             
  [Composer\Downloader\TransportException]                                   
  Content-Length mismatch, received 81664 bytes out of the expected 5694137  
                                                                             

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [--with-dependencies] [--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...


排查了好久,最后解决:

打开根目录的:composer.json文件,将

"scripts": {
        "post-install-cmd": "php init --env=Development --overwrite=n"
    },

去掉,重新执行composer命令即可即可,后面发新版,将会去掉这个

共收到 1 条回复
Fecmall#13年前 0 个赞

关于composer切换成阿里云中国镜像,详细参看我之前整理的文档:composer 默认地址改为中国镜像地址,以及中国镜像地址还原成默认地址

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics