Composer Content-Length Mismatch

First, run: composer config –list –global //this will get the composer home path. [home] /root/.composer //it’s my composer home path. And then, edit the config.json, make it like this: { “config”: { “github-protocols”: [ “https” ] }, “repositories”: { “packagist.org”: { “type”: “composer”, “url”: “https://packagist.org” } } } It will make the packagist connection force … Read more

How to add non-public repositories from command line with composer?

You can run the following from the project root to add a repository to the project’s composer.json: composer config repositories.repo-name vcs https://github.com/<orgname or username>/repo Then you can require the specific repo with: composer require <orgname or username>/repo:dev-branchname The Composer documentation covers it at Modifying Repositories (CLI: composer config).

Use PHP composer to clone git repo

That package in fact is available through packagist. You don’t need a custom repository definition in this case. Just make sure you add a require (which is always needed) with a matching version constraint. In general, if a package is available on packagist, do not add a VCS repo. It will just slow things down. … Read more