1

If I run...

composer require drupal/token

...I get...

Could not find a version of package drupal/token matching your minimum-stab  
  ility (dev). Require it with an explicit version constraint allowing its de  
  sired stability.

Not sure if this is relevant, but token is already installed in my site, but is not required in composer. I want to require (and upgrade) the module with composer.

Changing my minimum stability from dev to stable does not resolve the problem.

I am having the same problem with other modules when I try to run 'composer require'. Composer always responds with "Could not find a matching version of package..."

Here is a question I posted earlier today that may be related: Composer doesn't see that updates are needed

  • Does your composer.json have this in the respositories section? { "type": "composer", "url": "https://packages.drupal.org/8" } – Clive Jul 17 '18 at 13:59
  • No. And it appears that adding that section has resolved the problem. Go ahead and add that as an answer so I can accept it... if you like. Thanks! – arnoldbird Jul 17 '18 at 14:35
3

Sounds like Composer doesn't know about Drupal's packages, which suggests you're missing a reference to the repository in composer.json.

Add this and you should be good to go:

"repositories": [
  { 
    "type": "composer", 
    "url": "https://packages.drupal.org/8" 
  }
]
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.