Some dependencies were mistakenly added to require
instead of require-dev
. I tried manually changing composer.json
and running composer install
, but composer.lock
wasn't changed. So my guess is, that it ignored changes in composer.json
, and just ensured that what's installed reflects what's in composer.lock
file. Am I wrong here? If not wrong, how do I do that? I'd like to preserve versions of packages in composer.lock
file as they are now as much as possible.
Now just open the composer. json file and delete the dependency which you want to remove. Now we just need to run the composer update command once more and it will remove all the phpunit dependencies which we don't want as shown below: Running composer update once again.
require: These are must packages for the code to run. It defines the actual dependency as well as package version. require_dev: It defines the packages necessary for developing the project and not needed in production environment. Note: The require and require_dev are important parameters available in composer.
To update dependencies two commands can be used: composer update and composer require . The difference between these two commands is that composer update will try to update a dependency based on the current constraints in composer. json and will only update composer. lock .
I would do:
composer require --dev drupal/devel
or for your example
composer require --dev meenie/javascript-packer: 1.1
which makes composer do all the heavy lifting and moves those dependencies into the require-dev section.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With