I run:

composer require drupal/media:8.1.x-dev

and I get:

./composer.json has been updated
Gathering patches for root package.
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
1/2: http://packagist.org/p/provider-2016-10$5da3245ae3a6e36c4a4be4cee9c1c42a78fd2b203d6deda288effd75859b09c8.json
2/2: http://packagist.org/p/provider-latest$dc229f1d73e6457243e6c894cd84a8843abf2ac4336fdc158c73564f7dd5f197.json
Finished: success: 2, skipped: 0, failure: 0, total: 2
Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package drupal/meida could not be found in any version, there may be a typo in the package name.

Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see for more details.

Read for further common problems.

Installation failed, reverting ./composer.json to its original content.

What am I doing wrong?

Comments

hkirsman created an issue. See original summary.

slashrsm’s picture

Status: Active » Fixed
Issue tags: +D8Media

Correct version to require is "drupal/media:1.x-dev".

hkirsman’s picture

media:1.x-dev is definitely not correct. But now the initial "composer require drupal/media:8.1.x-dev" worked. Strange.

thamas’s picture

h@hkrisman From the do composer documentation (https://www.drupal.org/node/2718229):

Specifying a version

you can specify a version from the command line with:

$ composer require drupal/<modulename>:<version>

For example:

$ composer require drupal/ctools:3.0.0-alpha26 $ composer require drupal/token:1.x-dev

In these examples, the composer version 3.0.0-alpha26 maps to the drupal.org version 8.x-3.0-alpha26 and 1.x-dev maps to 8.x-1.x branch on drupal.org.

If you specify a branch, such as 1.x you must add -dev to the end of the version.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

nelslynn’s picture

Please accept my apologies for opening this issue if not appropriate.

I have tried both of the following:
composer require drupal/media:1.x-dev
composer require drupal/media:8.1.x-dev

And, I get the following:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package drupal/media could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

I have tried the suggestions at the link provided (https://getcomposer.org/doc/articles/troubleshooting.md), but I still get the error.

Any suggestions?

hkirsman’s picture

May be you're doing it in the wrong folder? You should be in the root of the project, not web/ or any other.

nelslynn’s picture

I'm doing from the root of the project.

All other composer commands work. This is the only one that produces an error.

joelhsmith’s picture

I am having the same problem with a different module

composer require drupal/views_slideshow:^8.4.3

I think it might not be related to the Media module, probably a different issue.

plato1123’s picture

I can't get composer to install any drupal modules and I can't figure out why.

composer require 'drupal/admin_toolbar:^1.22'
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
./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
- The requested package drupal/admin_toolbar could not be found in any version, there may be a typo in the package name.

Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see for more details.

Read for further common problems.

plato1123’s picture

I had to run this, even though I was able to install Drupal and drush and ?? using composer without it? Huh?!!!

composer config repositories.drupal composer https://packages.drupal.org/8

joseph.olstad’s picture

Is composer really necessary here?

joelhsmith’s picture

It is best to use composer to manage this stuff in Drupal 8. But yes, it would be possible to do it the old fashion way. But I would not recommend it as a long-term plan.