Silverstripe Elemental module install error

I am new at SS, so bear with me :slight_smile: I am trying to install the SS elemental module, but I get an installation error in the terminal.

Using a fresh install of SS version 4.5. Using this addon: https://addons.silverstripe.org/add-ons/dnadesign/silverstripe-elemental?_ga=2.238297733.468184042.1587133952-234258882.1587133952

So to install I execute this command: “composer require dnadesign/silverstripe-elemental ^4.5”

And receiving this error: Problem 1
- silverstripe/elemental-blocks 1.x-dev requires dnadesign/silverstripe-elemental ^2.0 → satisfiable by dnadesign/silverstripe-elemental[2.1.x-dev].

What am I doing wrong? Any advice?

Try:

composer require dnadesign/silverstripe-elemental ^4

and see if you get the same result.

Have you already installed any other packages? Particularly those around elemental (such as elemental blocks)

The latest version of that module available is 4.3.2 so like @Tim said, changing the version restraint to just ^4 should work.

You can also generally omit the version restraint and Composer will try to install the most up to date stable version that’s compatible with your Silverstripe installation. So you could just do composer require dnadesign/silverstripe-elemental.

BTW it looks like you might have assumed that since you’re using SS 4.5 you needed to put 4.5 in your composer command, but if it’s not already clear, that’s not the case. Module version numbers are usually independant of SS framework versions, so a module intended for SS4 might be at version 1, 0.1, 14 or anything at all :slight_smile:

Thanks guys. I have tried running both commands that you suggested. But keep getting the same error message.

I removed a package manually, and then run dev/build + ?flush. Is that the correct way to remove an addon/module? Anything needs to be updated in the composer file?

A bit strange…

To remove a module, use composer remove…, then do a dev/build.