Reputation: 838
We are trying to install the package google / recaptcha 1.1 through Composer, in order to install it Composer asks us to install the phpdocumentor package, however when running
# composer require --dev phpdocumentor / phpdocumentor dev-master
this gives us an error, about which I attach a screen print.
Previously to the current state Composer had indicated us a problem with nikic / php-parser package, we found that package listed in the file composer.lock and we removed it, however now composer gives us this error relative to the package symfony / console v4.1.1 that also it is listed in the composer.lock file, we also try to remove this dependency from the composer.lock, but I am not sure that we are doing things right by eliminating these dependencies. Because in addition to deleting one another error is indicated on another package and if we continue like this we would end up eliminating many dependencies. Please help!
Upvotes: 0
Views: 1772
Reputation: 61
PhpDocumentor you are trying to install requires phpDocumentor/Reflection
who requires nikic/php-parser
and this version is to high for your other dependencies.
use composer depends nikic/php-parser
to understrand what's wrong.
Upvotes: 0
Reputation: 2992
don't manually remove stuff from composer.lock
When you require packages without passing a specific version (like dev-master, or ^1) composer will download the latest versions respecting your composer.json and record those versions on composer.lock.
composer.lock is nothing but a byproduct of composer install
If you manually edit composer.lock, you are basically messing up composers internals.
The correct way to remove a package is either running composer remove vendor/package
or manually removing it from composer.json and then running composer update
composer.lock is sacred, don't touch it.
Now you've touched it and you want to unscrew yourself, so:
rm composer.lock
composer install
composer require --dev phpdocumentor/phpdocumentor dev-master
Same results, different approach:
rm composer.lock
composer install
Upvotes: 2