skip to Main Content

Deploy magento 2.4 got this error. this happens regularly, sometimes it works , sometime not.

n ClassReader.php line 24:
                                             
  Class adminhtmlConfigScope does not exist  
                                             


                                                         
  There are no commands defined in the "cache" namespace.  
                                                           


                                                           
  There are no commands defined in the "cache" namespace.  
                                                           

here is the script I used to deploy magento

rm -rf generated/*
rm -rf var/view_preprocessed/*
bin/magento maintenance:enable
bin/magento cache:clean
bin/magento cache:flush
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy en_US -f
bin/magento setup:static-content:deploy zh_Hans_CN -f
bin/magento cache:clean
bin/magento cache:flush
bin/magento maintenance:disable
bin/magento indexer:reindex
chmod -R 777 pub/media
chmod -R 777 pub/static
chmod -R 777 pub/opt
chmod -R 777 generated
chmod -R 777 var

2

Answers


  1. Chosen as BEST ANSWER

    I got this error because after when execute composer update, the magento/composer-root-update-plugin will update files in the root directory, these updated files need to be commited to source code. it turns outs they are being cleared somehow.

    run composer update, execute above commands again, problem solved.


  2. rm -rf vendor
    composer install
    

    solves the Problem in my case.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search