I want to uninstall (and not remove from my composer.json) dev dependencies on a project.
Is there a simple way to do this ?
When deploying in production, the command to use is composer install --no-dev . By default, composer will install dev dependencies. It is conventional to commit your composer. lock file with your application, but never the vendor folder Composer generates.
Updating dependencies to their latest versions# To update to the latest versions, use the update command. This will fetch the latest matching versions (according to your composer. json file) and update the lock file with the new versions.
Running install
or update
with --no-dev
should now remove dev requirements and their dependencies.
Original answer for historical purposes:
Actually no. You can manually rm -rf them from the vendor dir of course, but composer offers no way to uninstall the dev requirements after you did an install with --dev. It's not a huge use case but could warrant a new command line switch, if you would like to report an issue on github.
You can use following command after removing the dependencies in composer.json
file.
composer update
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