Composer autoloader not registering Twig on CentOS 7

  centos7, php, symfony, twig

I have Symfony 3.4.27 installed in the application I am working on. Twig is installed in the vendortwigtwig folder.

My problem is when I run the command composer dumpautoloader. It does not register that twig is vendor folder. I tried to manually add Twig to the autoload_psr4.php file inside the vendorcomposer folder.
However, that did not work out for me because when I ran the dump autoloader command again. It wiped out what I manually put in the system.

I checked the twigtwig folder for the composer.json file it is there. I tried How to update a single library with Composer?

 composer update vendor/twig

It replied Package “vendor/twig” listed for update is not installed. Ignoring.

So, how do I get composer to register the twig package?

Source: Symfony Questions