How to install a specific version of package using Composer?

And how to get list of all installed packages along with version in composer?

composer require vendor/package:version

Like :

composer require guzzlehttp/guzzle:6.3.3

This is very important when you are going to migrate one module of codes from one application to another application and want to have the same version installed in the new place.

Just use

composer show 

And you can also use the global instalation of composer:

composer global show

Yes sure!

We can run following

composer diagnose

Let’s run that.

As you see there is a warning! Since we use exact version of guzzle and we have to use semantic versioning for guzzle.

For solving this problem I just replace ~6.0 with 6.3.3 in composer.json and do following to upgrade guzzlehttp

composer update guzzlehttp/guzzle

Posting daily about Python, Nuclear Physicist PhD

Posting daily about Python, Nuclear Physicist PhD