You can run composer show -i (short for --installed ). In the latest version just use composer show .
To update your packages json file is. Run composer update (on your local machine) to update the required packages and re-generate a composer. lock file. Commit the updated composer.
Caret Version Range ( ^ )# The ^ operator behaves very similarly, but it sticks closer to semantic versioning, and will always allow non-breaking updates. For example ^1.2. 3 is equivalent to >=1.2. 3 <2.0. 0 as none of the releases until 2.0 should break backwards compatibility.
I know it's an old question, but...
composer.phar show
Will show all the currently installed packages and their version information. (This was shown in previous versions of Composer only when using the now-deprecated -i
option.)
To see more details, specify the name of the package as well:
composer.phar show monolog/monolog
That will show many things, including commit MD5 hash, source URL, license type, etc.
You can use composer show like this:
composer show package/name
If you're just interested to get the output as the package version number like: 1.7.5 or 1.x-dev or dev-master.
Linux console snippet (composer & sed):
composer show 'monolog/monolog' | sed -n '/versions/s/^[^0-9]\+\([^,]\+\).*$/\1/p'
or (composer, grep & cut):
composer show 'monolog/monolog' | grep 'versions' | grep -o -E '\*\ .+' | cut -d' ' -f2 | cut -d',' -f1;
Technically "dev-master" is the exact version that you ended up using there. It is the development branch, and thus the very latest version.
The best place to look for available versions for composer packages is Packagist since that's the place composer loads the versions from when you install packages. The monolog versions are listed on http://packagist.org/packages/monolog/monolog.
You can use show all, specially when dont have package.json file, get available packages from packagist.org:
composer show "monolog/monolog" --all
Also you can specify versions
composer show "monolog/monolog" 1.* --all
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With