Tyssen
Tyssen

Reputation: 1711

Can't install Twig with composer

I'm trying to install Twig with composer require twig/twig but get back:

Could not find package twig/twig. Did you mean one of these? twig/twig

So it's suggesting to me the package I'm trying to install that it says it can't find.

Has anyone else had this before?

Upvotes: 0

Views: 584

Answers (2)

karolus
karolus

Reputation: 922

Reverting to Composer 1.x could potentially cause problems down the line (in addition to being much more memory-intensive than Composer 2.x), especially if you're working on multiple projects on your machine.

What about running:

composer require twig/twig:^1.0 (For Twig 1.x)

composer require twig/twig:^2.0 (For Twig 2.x)

Upvotes: 0

Tyssen
Tyssen

Reputation: 1711

Turns out my problem was I'd upgraded to Composer 2. When I reverted back to 1 I was able to install.

Upvotes: -1

Related Questions