In your composer.json
, you can put:
{
"require": {
"vendor/package": "version"
}
}
then run composer install
or composer update
from the directory containing composer.json
. Sometimes, for me, composer is hinky, so I'll start with composer clear-cache; rm -rf vendor; rm composer.lock
before composer install
to make sure it's getting fresh stuff.
Of course, as the other answers point out you can run the following from the terminal:
composer require vendor/package:version
And on versioning:
- Composer's official versions article
- Ecosia Search