After installing Drupal 8 using drupal-composer I wanted to download devel.
Following the instructions in the README I tried this:
composer require drupal/devel:8.*
and got this error:
zsh: no matches found: drupal/devel:8.*
This works however
composer require drupal/devel
I got this:
Using version 8.1.x-dev for drupal/devel
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Updating drupal/devel dev-8.x-1.x (8e745a9 => 9a331e7)
Checking out 9a331e760b2ffa32a1271a155a74cb3fab213e62
Was I using the wrong syntax?
Does README.md need to be updated?
Oh, I can see from my composer.json diff that devel was already there, even before my "attempt to download it"
--- a/composer.json
+++ b/composer.json
@@ -21,7 +21,7 @@
"drush/drush": "8.*",
"drupal/console": "~0.8",
- "drupal/devel": "8.1.*@dev",
+ "drupal/devel": "8.1.x-dev",
"drupal/token": "8.1.*@dev"
},
"minimum-stability": "dev",
So, a better example for the README might be something like:
composer require drupal/bootstrap
Reading the composer documentation for require https://getcomposer.org/doc/03-cli.md#require I feel like composer require drupal/bootstrap:8.* should work, but it gives me no matches found
This is caused by the globbing feature of zsh. It is not specific to composer. The problem should occur to any command when using * outside of quotes. For solving the problem you need to at least put the version constraint in quotes:
composer require drupal/devel:"8.*"
composer require "drupal/devel:8.*"
Then zsh does not interpret the asterisk as a wildcard for globbing.
Yes it was zsh globbing. Thanks for spotting that.
Most helpful comment
This is caused by the globbing feature of zsh. It is not specific to composer. The problem should occur to any command when using
*outside of quotes. For solving the problem you need to at least put the version constraint in quotes:Then zsh does not interpret the asterisk as a wildcard for globbing.