When I add a repository of type: path to composer.json in root of installation, composer successfully installs the package from the url specified but bin/magento throws the above mentioned error during it's readiness check.
Command line stacktrace:
We're sorry, an error occurred. Try clearing the cache and code generation directories. By default, they are: var/cache, var/di, var/generation, and var/page_cache.
[Zend\ServiceManager\Exception\ServiceNotCreatedException]
An abstract factory could not create an instance of magentosetupconsolecommandcronruncommand(alias: Magento\Setup\C
onsole\Command\CronRunCommand).
[Zend\ServiceManager\Exception\ServiceNotCreatedException]
An exception was raised while creating "Magento\Setup\Console\Command\CronRunCommand"; no instance returned
[Zend\Di\Exception\MissingPropertyException]
Missing instance/object for parameter readinessCheck for Magento\Setup\Console\Command\CronRunCommand::__construct
[Zend\ServiceManager\Exception\ServiceNotCreatedException]
An abstract factory could not create an instance of magentosetupmodelcronreadinesscheck(alias: Magento\Setup\Model\
Cron\ReadinessCheck).
[Zend\ServiceManager\Exception\ServiceNotCreatedException]
An exception was raised while creating "Magento\Setup\Model\Cron\ReadinessCheck"; no instance returned
[Zend\Di\Exception\MissingPropertyException]
Missing instance/object for parameter phpReadinessCheck for Magento\Setup\Model\Cron\ReadinessCheck::__construct
[Zend\ServiceManager\Exception\ServiceNotCreatedException]
An abstract factory could not create an instance of magentosetupmodelphpreadinesscheck(alias: Magento\Setup\Model\P
hpReadinessCheck).
[Zend\ServiceManager\Exception\ServiceNotCreatedException]
An exception was raised while creating "Magento\Setup\Model\PhpReadinessCheck"; no instance returned
[Zend\Di\Exception\MissingPropertyException]
Missing instance/object for parameter composerInformation for Magento\Setup\Model\PhpReadinessCheck::__construct
[Zend\ServiceManager\Exception\ServiceNotCreatedException]
An abstract factory could not create an instance of magentoframeworkcomposercomposerinformation(alias: Magento\Fram
ework\Composer\ComposerInformation).
[Zend\ServiceManager\Exception\ServiceNotCreatedException]
An exception was raised while creating "Magento\Framework\Composer\ComposerInformation"; no instance returned
[InvalidArgumentException]
Repository type is not registered: path
Hi @johnbendi ,
could you, please, show an example of your composer.json?
As I can see from Composer's documentation (https://getcomposer.org/doc/04-schema.md#repositories) there is no type "path" in the list of repository types.
@buskamuza please look here https://getcomposer.org/doc/05-repositories.md#path
@dbritan , got it, thanks.
"path" is added in Composer version 11, while Magento uses version 10. So Composer library throws this exception, when we try to work with newer version of composer.json.
For now, looks like ./bin/magento is incompatible with format of composer.json newer then v.10 of Composer.
We'll review if it's possible to fix Magento CLI still depending on v.10 or should we update to v.11 of Composer.
Internal ticket MAGETWO-46666
I've the same problem described by @johnbendi.
This is a very interesting feature for extensions developers.
Hi Magento team, :)
Are there any updates for this issue? It will really help to start using "path" repository for module development.
Thanks.
_Note: I removed my useless two previous messages_
Ok, so. You can force composer to use a specific version for another… Let me explain with a really simple example.
Replace in your composer.json the require of composer/composer with this line:
"composer/composer": "dev-master as 1.0.0-alpha10"
It will say composer to use the master branch as version 1.0.0-alpha10 (version required by all Magento modules right now).
Hope this help :)
(Edit: Of course run a composer update after that…)
++
Hi @jacquesbh,
It now works as expected. Thank you.
I appreciate your fast response.
@benmarks thanks for tweet.
Magento depends on Composer version 1.0.0-beta1 now, so repository of type "path" should be supported.
Can we close then?
This issue is still present in v2.0.5. The 2.0 branch still uses 1.0.0-alpha-10: https://github.com/magento/magento2/blob/2.0/composer.json#L41
Also, there are now stable versions of both composer 1.0 and 1.1, so perhaps upgrade to 1.1.x?
Related internal ticket is MAGETWO-52770
@barryvdh , we're considering upgrading to the latest stable version. Thanks for the suggestion.
@johnbendi, thank you for your report.
The issue is already fixed in 2.2.0
Most helpful comment
_Note: I removed my useless two previous messages_
Ok, so. You can force composer to use a specific version for another… Let me explain with a really simple example.
Replace in your composer.json the require of
composer/composerwith this line:It will say composer to use the
masterbranch as version1.0.0-alpha10(version required by all Magento modules right now).Hope this help :)
(Edit: Of course run a
composer updateafter that…)++