Torkil Johnsen
Torkil Johnsen

Reputation: 2443

Can't remove unused package in Composer

Composer made me aware that a package was outdated, and needed upgrading.

1 package is not up to date:
 - google/cloud (v0.49.0) latest is v0.69.0

This package was unknown to me, but I am working with several other developers, so I checked:

$ composer why google/cloud
There is no installed package depending on "google/cloud"

Long story short, I am having difficulties removing this package. For instance with remove:

$ composer remove google/cloud
google/cloud is not required in your composer.json and has not been removed

I even tried composer require google/cloud:^0.49, and then did composer remove google/cloud afterwards, …but it is not removed from the vendor folder or the composer.lock file.

Upvotes: 1

Views: 909

Answers (1)

Torkil Johnsen
Torkil Johnsen

Reputation: 2443

A month later I think I found the answer by accident:

$ composer why google/cloud-storage
google/cloud                          v0.49.0  replaces  google/cloud-storage (1.3.0)       
superbalist/flysystem-google-storage  7.0.0    requires  google/cloud-storage (>=1.0 <1.4)

So composer can't see why google/cloud is required, since google/cloud-storage is the one that is really required, but it is replaced by google/cloud. Or so it might seem.

Upvotes: 1

Related Questions