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.

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

composer show 

And you can also use the global instalation of composer:

composer global show

Can we diagnose installed packages?

We can run following

composer diagnose

Let’s run that.

Image for post
Image for post

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

Written by

Web geek, Self-taught full-stack web developer, Learning Python, Laravel, Vuejs, UX/UI design, Nuclear Physicist PhD

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store