Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to uninstall dev dependencies with composer?

I want to uninstall (and not remove from my composer.json) dev dependencies on a project.

Is there a simple way to do this ?

like image 658
Yohan G. Avatar asked Dec 06 '12 13:12

Yohan G.


People also ask

What is composer install -- no Dev?

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.

How do I update dependency in composer?

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.


2 Answers

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.

like image 50
Seldaek Avatar answered Sep 19 '22 21:09

Seldaek


You can use following command after removing the dependencies in composer.json file.

composer update 
like image 23
Koray Güclü Avatar answered Sep 20 '22 21:09

Koray Güclü