Composer vendor directory not found

From MoodleDocs

From Moodle 5.1 Moodle uses Composer to install some dependencies, and checks whether these dependencies have been installed

This error message indicates that the dependencies have not been correctly installed.

To correctly install these dependencies you should run the following command from your Moodle root directory:

composer install --no-dev --classmap-authoritative

See the Composer Documentation for installation on how to install Composer.