Updating Drush to the Latest Stable Version
Drush 11.0 the stable was released 2022-01-11
https://github.com/drush-ops/drush/releases/tag/11.0.0
Many options to change to
- 1.
"drush/drush": "~11.0",
- 2.
"drush/drush": "~10.0 || ~11.0",
- 3.
"drush/drush": "^10.0",
- 4.
"drush/drush": "@stable",
The root
composer.json
file for the default Varbase Project template was changed "drush/drush": "~11.0",
for easier support, update, and upgrade processes in development and production servers. In Varbase 9.0.8 release drush was changed to ~11.0.
Updating drush in the root composer.json file for a project.
Use any text editor and change to "drush/drush" to the following
"drush/drush": "~11.0",
composer require "drush/drush:~11.0" --dev
The Update Helper
~3.0
is using "drush/drush": "~11.0"
and the Drupal Core Generator package is using "chi-teck/drupal-code-generator": "^2.4"
In
require-dev
of the moduleThis module has the Drush command. In order to execute it properly, you have to use Drush installed with your project.
In the case of composer build, it's:
[project directory]/vendor/bin/drush
They started to ask developers to use the drush command. not the one in the global, the one in the vendor.
Not recommended to use the local global drush or the server global drush
Change the directory in the terminal to the project directory.
cd [project directory]
Run the following command for example:
./vendor/drush/drush/drush cr
Then command will use the local drush command directly from
vender
in case the following composer config was not in the root composer.json
file for the project "bin-dir": "bin/",
The default Varbase Project template has the
"bin-dir": "bin/",
composer config in the root composer.json
file.If the current working directory was the
docroot
folder in the opened terminalcd [project directory]/docroot
Run the following command for example:
../bin/drush cr
Last modified 2mo ago