5

Is there a way to disable some modules during install using cli, same way as it is possible in web wizard? Or is there a way to force composer to not even download some modules?

3 Answers 3

1

We can use the "replace" section in composer.json if you do not want to load any of the modules.

eg: If you do not want to load yotpo/magento2-module-yotpo-reviews you can add the following in composer.json. This will remove yotpo module loading in /vendor folder.

"replace": {
  "yotpo/magento2-module-yotpo-reviews": "*"
}

Please let me know if this works for you

0

Yes, there is a way if you are using Magento 2.3 or above, you can use --disable-modules

Example

As you can see in the last line, you can specify many modules at the same time.

php -f bin/magento setup:install \
 --base-url='https://local.magento2.com/' \
 --db-host=db \
 --db-name=magento \
 --db-user=magento \
 --db-password=magento \
 --admin-firstname=Rafael \
 --admin-lastname=Correa \
 [email protected] \
 --admin-user=admin \
 --admin-password=adminpassword \
 --language=en_CA \
 --currency=CAD \
 --use-rewrites=1 \
 --backend-frontname=admin \
 --elasticsearch-host=elasticsearch \
 --disable-modules='Yotpo_Yotpo,Vertex_AddressValidation,Smile_ElasticsuiteVirtualCategory'
4
  • Could you provide a link to documentation? From which version is it possible? Commented Aug 11, 2020 at 19:45
  • This works starting with version 2.3
    – Marius
    Commented Aug 11, 2020 at 20:23
  • Could you provide a link to documentation? Commented Aug 12, 2020 at 0:09
  • Hi @michalhosna, I didn't find it in the DevDocs or any other documentation. Commented Aug 12, 2020 at 15:41
-2

You can disable existing modules using Magento CLI:

bin/magento module:disable Vendor_Module

If you want to download only specific modules using composer you have to create custom composer.json for this purpose, specifying only modules and libraries you'd like to fetch under require key.

1
  • Yes, i know that. I have an installation script for magento, and the current version is doing it exactly like that. But i wanted more like be able to disable modules before or during installation, like in web gui installation. But anyway, thanks! Commented Feb 4, 2017 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.