Skip to content
Advertisement

composer doesn’t install dotenv on Symfony 3.4

I have Symfony 3.4 project and am trying to install the Dotenv component. I’ve ran this command composer require symfony/dotenv:^3.4 and composer said “Nothing to install or update”.

I’ve deleted vendor folder also tried to install the Dotenv component on brand new Symfony 3.4 project, the result is the same. Any ideas?

Advertisement

Answer

After installing symfony/symfony (~3.4) the symfony/dotenv is already installed.

Take a look at Packagist symfony/symfony#v3.4.43. As you can see, it “replaces” the package called symfony/dotenv, which is expected.

Instead of using composer show, try asking composer why symfony/dotenv. It clearly states: symfony/symfony replaces symfony/dotenv.

Also take a look at your lokal vendor/ directory. There you should find the source you’re looking for:

ls -l vendor/symfony/symfony/src/Symfony/Component/Dotenv/
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement