My goal is to run a Composer's require
command to initialise a Symfony Console project.
When running composer's require
command, I believe it is possible to restrict the required package to specific a version.
I am considering using this to stick to the Long Term Release version of Symfony which will be supported for longer.
According to the Symfony Release Process the current LTS version is 3.4
.
According to Composer's require
command documentation and Composer's version constraints documentation, the package and version can be specified as: symfony/console:~3.4
.
However, when I run the composer
command to install symfony/console 3.4 in an empty directory I get the following errors. (I have PHP and Composer is installed on my MacOS High Sierra):
$ mkdir foo
$ cd foo
$ composer self-update
You are already using composer version 1.6.2 (stable channel).
Johns-MBP:foo jw$ php --version
PHP 7.1.7 (cli) (built: Jul 15 2017 18:08:09) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
I have created a new directory, changed into it, ensured composer is updated to the latest version and ensured PHP is 7.*.
$ composer require symfony/console:~3.4
No composer.json in current directory, do you want to use the one at /Users/me/Documents/Projects/FilterProject/filter-environment? [Y,n]? Y
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: don't install symfony/console v3.4.3
- Conclusion: don't install symfony/console v3.4.2
- Conclusion: don't install symfony/console v3.4.1
- symfony/process v2.6.4 conflicts with symfony/console[v3.4.0].
- symfony/console v3.4.0 conflicts with symfony/process[v2.6.4].
- Installation request for symfony/console ~3.4 -> satisfiable by symfony/console[v3.4.0, v3.4.1, v3.4.2, v3.4.3].
- Installation request for symfony/process (locked at v2.6.4, required as ~2.0) -> satisfiable by symfony/process[v2.6.4].
Installation failed, reverting ./composer.json to its original content.
I am quite new to Symfony and so may be misunderstanding the connection between the version number used for Symfony core versus the version number used by Symfony/console.
Which composer command does one run to require
the LTS version of Symfony Console in fresh project?