ok turns out json api is installed. why doesnt drupal report this?

might be very useful to others to add a note on project page to reflect this.

thanks

Comments

Syntapse created an issue. See original summary.

Syntapse’s picture

same response for latest stable release:

composer require 'drupal/jsonapi:^2.4' --prefer-dist --profile

also fails.

I am really struggling to make sense of the logic in the message.

Syntapse’s picture

Composer 'conclusions' don't make any sense.

Problem 1
    - Conclusion: remove drupal/core 8.7.8
    - Conclusion: don't install drupal/core 8.7.8

composer file...

bash-4.4# cat composer.json
{
    "name": "drupal-composer/drupal-project",
    "description": "Project template for Drupal 8 projects with composer",
    "type": "project",
    "license": "GPL-2.0-or-later",
    "authors": [
        {
            "name": "",
            "role": ""
        }
    ],
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ],
    "require": {
        "php": ">=7.0.8",
        "composer/installers": "^1.2",
        "cweagans/composer-patches": "^1.6.5",
        "drupal-composer/drupal-scaffold": "^2.5",
        "drupal/admin_toolbar": "^1.27",
        "drupal/console": "^1.0.2",
        "drupal/consumers": "1.x-dev",
        "drupal/core": "^8.7.0",
        "drupal/entity_usage": "2.x-dev",
        "drupal/filefield_sources": "1.x-dev",
        "drupal/module_filter": "^3.1",
        "drupal/paragraphs": "1.x-dev",
        "drupal/simple_oauth": "4.x-dev",
        "drupal/smtp": "1.x-dev",
        "drush/drush": "^9.0.0",
        "vlucas/phpdotenv": "^2.4",
        "webflo/drupal-finder": "^1.0.0",
        "webmozart/path-util": "^2.3",
        "zaporylie/composer-drupal-optimizations": "^1.0"
    },
    "require-dev": {
        "webflo/drupal-core-require-dev": "^8.7.0"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "sort-packages": true
    },
    "autoload": {
        "classmap": [
            "scripts/composer/ScriptHandler.php"
        ],
        "files": ["load.environment.php"]
    },
    "scripts": {
        "pre-install-cmd": [
            "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
        ],
        "pre-update-cmd": [
            "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
        ],
        "post-install-cmd": [
            "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
        ],
        "post-update-cmd": [
            "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
        ]
    },
    "extra": {
        "composer-exit-on-patch-failure": true,
        "patchLevel": {
            "drupal/core": "-p2"
        },
        "installer-paths": {
            "web/core": ["type:drupal-core"],
            "web/libraries/{$name}": ["type:drupal-library"],
            "web/modules/contrib/{$name}": ["type:drupal-module"],
            "web/profiles/contrib/{$name}": ["type:drupal-profile"],
            "web/themes/contrib/{$name}": ["type:drupal-theme"],
            "drush/Commands/contrib/{$name}": ["type:drupal-drush"]
        },
        "drupal-scaffold": {
            "initial": {
                ".editorconfig": "../.editorconfig",
                ".gitattributes": "../.gitattributes"
            }
        }
    }
}

I am running version 8.7.8 of drupal and weblo/dev. these errors dont make sense.

Syntapse’s picture

Updating to composer 1.9 (latest) yields the same result.

Syntapse’s picture

bash-4.4# composer show webflo/drupal-core-require-dev

Do not run Composer as root/super user! See https://getcomposer.org/root for details
name     : webflo/drupal-core-require-dev
descrip. : require-dev dependencies from drupal/core
keywords :
versions : * 8.7.8
type     : metapackage
license  : GNU General Public License v2.0 or later (GPL-2.0-or-later) (OSI approved) https://spdx.org/licenses/GPL-2.0-or-later.html#licenseText
source   : [git] https://github.com/webflo/drupal-core-require-dev.git 593123300b3cf9974fa0742282af90fa72ac06fc
dist     : [zip] https://api.github.com/repos/webflo/drupal-core-require-dev/zipball/593123300b3cf9974fa0742282af90fa72ac06fc 593123300b3cf9974fa0742282af90fa72ac06fc
path     : /var/www/html
names    : webflo/drupal-core-require-dev

requires
behat/mink 1.7.x-dev
behat/mink-goutte-driver ^1.2
behat/mink-selenium2-driver 1.3.x-dev
drupal/coder ^8.3.1
drupal/core 8.7.8
jcalderonzumba/gastonjs ^1.0.2
jcalderonzumba/mink-phantomjs-driver ^0.3.1
justinrainbow/json-schema ^5.2
mikey179/vfsstream ^1.2
phpspec/prophecy ^1.7
phpunit/phpunit ^4.8.35 || ^6.5
symfony/css-selector ^3.4.0
symfony/debug ^3.4.0
symfony/phpunit-bridge ^3.4.3
Syntapse’s picture

I think this module has a dependency issue. I installed jsonapi_extras no problem

bash-4.4#  composer require 'drupal/jsonapi_extras:3.x-dev' --prefer-dist --profile
Do not run Composer as root/super user! See https://getcomposer.org/root for details
[158.5MiB/2.34s] ./composer.json has been updated
[161.2MiB/3.33s] > DrupalProject\composer\ScriptHandler::checkComposerVersion
[163.1MiB/3.34s] Loading composer repositories with package information
[163.4MiB/3.63s] Updating dependencies (including require-dev)
[441.6MiB/26.26s]     1/1:      https://codeload.github.com/e0ipso/shaper/legacy.zip/a9b1420201ca3d0831d91879f72bf90e1186fd32
[441.6MiB/26.26s]     Finished: success: 1, skipped: 0, failure: 0, total: 1
[441.6MiB/26.27s] Package operations: 2 installs, 0 updates, 0 removals
[441.6MiB/26.27s]   - Installing e0ipso/shaper (1.2.2): [441.6MiB/26.28s] Loading from cache[441.6MiB/26.28s]
[441.6MiB/26.41s]   - Installing drupal/jsonapi_extras (dev-3.x ef0714c): [441.6MiB/27.55s] Cloning ef0714c6b3 from cache
[438.8MiB/30.13s] Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
[438.4MiB/33.79s] Writing lock file
[438.4MiB/33.79s] Generating autoload files
[438.8MiB/35.24s] > DrupalProject\composer\ScriptHandler::createRequiredFiles
[438.9MiB/35.24s] Memory usage: 438.85MiB (peak: 542.54MiB), time: 35.24s

plus lots of other contrib modules. jsonapi only one tested not installing on 8.7.8

Syntapse’s picture

tried reinstalling on another brand new drupal 8.7.8 just to be sure. same issue.

Syntapse’s picture

Issue summary: View changes
spokje’s picture

The JSON:API Module is included in Drupal Core since D8.7, so you don't have to install the Contrib Module any more.

I think your composer is trying to tell you the vendor-name/package-nameof the Contrib Module and the Core Module clash, so it tries to either _not_ install Drupal Core (of which the JSON:API is a module) or _not_ install the Contrib Module.

Syntapse’s picture

thanks for your reply this information would be useful on the site page. drupal also needs some kind of "module already installed" message to replace the cryptic errors seen above. out of interest are the contrib and core modules different? if so that sounds like a total headache.

spokje’s picture

AFAIK the Core Module gets updated the last, so new stuff is in the Core-dev branch.

The situation that a Contrib Module gets introduced in Core is quite rare, the fact that it has colliding "namespaces" is even more rare.
(The Contrib Module is only around until Core D8.8 is officially launched, at which point D8.6, which hasn't got JSON:API in it, becomes unsupported.)

TLDR: You've entered the stage at exactly the wrong time :)
Yes, all the things you've mentioned should be nicer, but since this is rather an exceptional, rare situation, which in the case of JSON:API will be over shortly, I think the "pragmatic" approach was taken.

Having said that: I actually thought it was mentioned on the Contrib Module page, if not, I agree it _should_, but I'm not in any way/shape/form a maintainer of this module, so please: Don't take anything I write here as Written In Stone/The Absolute Truth ;)

wim leers’s picture

Category: Bug report » Support request
Priority: Major » Normal
Status: Active » Fixed

thanks for your reply this information would be useful on the site page

That information has been on the project page ever since Drupal 8.7.0 shipped on May 1, 2019.

That being said, yes, when using composer, the transition is tricky and the error messages confusing. @Spokje explained why :) (Thanks, @Spokje!)

wim leers’s picture

Status: Fixed » Closed (fixed)

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