0

Where and how to clean the vendor folder?

"If something is corrupt in your composer and you do composer install/update it won't fix it. You have to force reinstall that package. Try cleaning the vendor folder and run composer install or composer update"

3 Answers 3

8

The vendor folder is inside your working directory:

enter image description here

You can remove it with command line:

rm -rf vendor/* 

After that run composer:

composer update 
1
0

If "composer update" doesn't work, then may want to try execute Install after rm command. Like this:

rm -rf vendor/* 

After than run composer:

composer install 

That will install/download the vendor directory content.

If your composer command not finished but killed, then can try to increase the memory_limit in the php.ini file. So will allow it use more memory for the composer process.

Can check the current memory_limit from your SSH console:

php -i | grep memory 

Hope that would help to someone.

0

I wrote a short shell script that does the job for me. It checks if you are in the correct directory, where the composer.json is inside.

#!/bin/sh if [ ! -f "./composer.json" ] then echo "File ./composer.json does not exists" exit 1 fi if [ ! -d "./vendor" ] then echo "Directory ./vendor does not exists" fi # First call without --quiet to get the output of what exactly was changed composer install "$@"; rm -rf ./vendor; # Second call after deleting vendor folder to reinstall everything but with --quiet to not push out the previous output composer install "$@" --quiet; 

It works also with parameters, e.g.:

composer-reinstall -vvv 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.