PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, February 18, 2022

[FIXED] Install RC1 version with composer for Drupal 8 module

 February 18, 2022     composer-php, drupal-8, installation, module, version     No comments   

Issue

I need to install a specific RC1 version for a Drupal 8 module with composer.

Example: https://www.drupal.org/project/field_group (8.x-3.0-rc1)

I've tried to use the constraint: '8.x-3.0-rc1'.

composer require drupal/field_group:8.x-3.0-rc1

The error message:

[UnexpectedValueException]
Could not parse version constraint 8.x-composer: Invalid version string "8.x-composer"

Solution

You can specify the version of the module / theme you want to download as follows:

composer require drupal/<modulename>:<version>

For example:

composer require 'drupal/token:^1.5'
composer require 'drupal/simple_fb_connect:~3.0'
composer require 'drupal/ctools:3.0.0-alpha26'
composer require 'drupal/field_group:3.0-rc1'
composer require 'drupal/token:1.x-dev'

To avoid problems on different terminals/shells, surround the version in quotes as in the examples above. In these examples, the versions map as follows:

  • ^1.5: maps to the latest stable 8.x-1.x release of the module.
  • ~3.0: maps to the latest stable 8.x-3.x release of the module.
  • 3.0.0-alpha26: maps to version 8.x-3.0-alpha26
  • 3.0-rc1: maps to version 8.x-3.0-rc1
  • 1.x-dev: maps to 8.x-1.x-dev

For more on version constraints with ~ (tilde) and ^ (caret) see Next Significant Release Operators.



Answered By - Kevin Wenger
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing