-2

I'm working as a part of a development team where my colleagues (team members) work in separate Git branches created out of and then merging their branches into a common development branch, develop.

After fetching, checking out and pulling the latest changes in one of their branches and clearing the cache using Drush, I get the below errors in Git bash. These errors also started appearing when I visited my site's homepage's URL in the browser.

PHP Warning:  require(C:\xampp\htdocs\drupal9\vendor\composer/../../web/core/includes/bootstrap.inc): failed to open stream: No such file or directory in C:\xampp\htdocs\drupal9\vendor\composer\autoload_real.php on line 45
PHP Fatal error:  require(): Failed opening required 'C:\xampp\htdocs\drupal9\vendor\composer/../../web/core/includes/bootstrap.inc' (include_path='C:\xampp\htdocs\drupal9\vendor/pear/archive_tar;C:\xampp\htdocs\drupal9\vendor/pear/console_getopt;C:\xampp\htdocs\drupal9\vendor/pear/pear-core-minimal/src;C:\xampp\htdocs\drupal9\vendor/pear/pear_exception;C:\xampp\php\PEAR') in C:\xampp\htdocs\drupal9\vendor\composer\autoload_real.php on line 45

Warning: require(C:\xampp\htdocs\drupal9\vendor\composer/../../web/core/includes/bootstrap.inc): failed to open stream: No such file or directory in C:\xampp\htdocs\drupal9\vendor\composer\autoload_real.php on line 45

Fatal error: require(): Failed opening required 'C:\xampp\htdocs\drupal9\vendor\composer/../../web/core/includes/bootstrap.inc' (include_path='C:\xampp\htdocs\drupal9\vendor/pear/archive_tar;C:\xampp\htdocs\drupal9\vendor/pear/console_getopt;C:\xampp\htdocs\drupal9\vendor/pear/pear-core-minimal/src;C:\xampp\htdocs\drupal9\vendor/pear/pear_exception;C:\xampp\php\PEAR') in C:\xampp\htdocs\drupal9\vendor\composer\autoload_real.php on line 45

Usually I can fix errors but I don't how to fix the above since PHP has pointed out files which are in the vendor folder, created by Composer for all project dependencies, and Drupal core folder. Trying to debug each error by modifying code in each dependency's and core folder's source code would not be a good idea because that is not the standard approach to fixing errors thrown by Composer and Drupal.

Can anyone please help me?

The Drupal core version is 9.1.0.

1 Answer 1

0

Okay, I was able to fix all the errors in one go. I simply executed composer update and Composer pulled in all the missing dependencies in composer.json added by my colleagues and the errors went away. Cheers. :)

1
  • 1
    You should be running composer install, not update. That will install all the packages at the specified versions listed in the composer.lock file, which should be in source control too.
    – Greg W
    May 24 at 21:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.