4

I have cloned a project written in Yii2. There are some extensions in vendor folder which I want to remove them from project. How can I do this? I am sure they are installed using composer because they are noted in composer.lock file.

rob006
  • 21,383
  • 5
  • 53
  • 74
hd.
  • 17,596
  • 46
  • 115
  • 165

2 Answers2

7

If you just want to remove packages from the vendor folder you can use composer command:

composer remove package/name

If you want to remove calls to these packages in the project you need to do this manually.

Bizley
  • 17,392
  • 5
  • 49
  • 59
  • I try composer remove phpunit/phpunit , but nothing is removed from vendor folder. :( – hd. Apr 16 '17 at 10:46
  • Look in `composer.json` and ensure the name is correct. If `composer remove package/name` removed the entry in your `composer.json` then run `composer update`. It should add/update/remove packages from your `vendor` directory based on the contents in your `composer.json` – Wade Apr 17 '17 at 00:00
3

You can delete the line with the name of the package from the composer.json and make in command line composer update

gud3
  • 555
  • 3
  • 10