DEV Community

Paboda Hettiarachchi
Paboda Hettiarachchi

Posted on

Using artifact method to install modules via composer

Sometimes we have to check a certain module in a new Magento version which can be incompatible due to modules's composer.json, eg. new php version not made compatible.

When there are version compatibility issues in module composer.json files, we are unable to install via "composer require" commands.

In root composer.json add the following:

  1. Create a folder named "zips" and add the proper path
"repositories": {
        ---

        "example-mods": {
          "type": "artifact",
          "url": "/<path>/zips"
        }
    },
Enter fullscreen mode Exit fullscreen mode
  1. Do any changes in the module folder (i.e. something like updating the php version) and create a .zip of the module
    Alt Text

  2. Add the above .zip folder to /zips location. The name of the zip file should be "module-exampl1" as per the above composer.json
    Alt Text

  3. In your root folder, run the composer command to install the module

composer require sample/module-exampl1

Oldest comments (0)