nordicmaterial
4/25/2019 - 4:08 PM

COMPOSER UPDATE > D8-9 core + modules

**composer.json** = the file Composer uses to know what packages it should install.

**composer.lock** = Composer’s own detailed record of what’s actually installed.



**// First, VERIFY that updates of Drupal actually are available:**

`composer outdated "drupal/*"`

**//////////////////////////
// CORE UPDATES:
//////////////////////////**

**1) Check of "recommended" aanstaat:**

`composer show drupal/core-recommended`

(If drupal/core-recommended is installed, this command returns information about the package.
If drupal/core-recommended is not installed, this command returns "Package drupal/core-recommended not found")

**2A) Indien drupal/core-recommended bestaat:**

`composer update drupal/core 'drupal/core-*' --with-all-dependencies`

Recommended kan probleem veroorzaken:
(Your requirements could not be resolved to an installable set of packages.)

-->" drupal/core-recommended is a meta-package pinning down its dependencies. 
It is meant to get you drupal/core in a particular version and its dependencies in an exactly specified version. 
Recommend against using it (pun intended). 

Suggest to replace it with drupal/core to not pin the dependencies to a specific version."
Alternatief:

`composer update drupal/core* --with-all-dependencies`

of 

`composer update`

**2B: Indien drupal/core-recommended NIET bestaat:**

`composer update drupal/core --with-dependencies`

3. drush updatedb
4. drush cr

//////////////////////////

SPECIFIC VERSION: 
`composer require drupal/core-recommended:^8.9.11 --update-with-dependencies`

`composer require drupal/core-recommended:^9.0.0 drupal/core-composer-scaffold:^9.0.0 drupal/core-project-message:^9.0.0 --update-with-dependencies --no-update`

- vervolgens: -
`composer update`

///////////////////////////////////////////

ERROR [ErrorException] default.services.yml): failed to open stream: Permission denied

OPLOSSING:
Zoek deze code in composer.json. Vul aan met de file mapping:

`"drupal-scaffold": {
            "locations": {
                "web-root": "web/"
            },
              "file-mapping": {
                "[web-root]/sites/default/default.services.yml": false,
                "[web-root]/sites/default/default.settings.php": false
              }
        },`


**//////////////////////////
// MODULE UPDATES:
//////////////////////////**

`composer update drupal/modulename --with-dependencies`

`drush updatedb
drush cr`

// FORCE UPDATE A MODULE TO A CERTAIN VERSION:
// vb:
`composer require drupal/field_group:3.x-dev
composer require drupal/admin_toolbar:2.0.0`



**//////////////////////////
// CORE UPDATE BLOCKED:
//////////////////////////**

// CORE WIL NIET UPDATEN NAAR LAATSTE VERSIE - W SOMS GEBLOKKEERD DOOR OUDE SUBMODULE:
//For each outdated module you would need to find out whether it is blocked. Use:

`composer prohibits drupal/core:8.8.1`