1

After Install Magento2.3 by cli and when try upgrade command getting below Error:

php bin/magento setup:upgrade

The directory "generated/code/Magento/Backend/App/Request" cannot be deleted Warning!rmdir(generated/code/Magento/Backend/App/Request): Directory not empty The directory "generated/code/Magento/Catalog/Model/ResourceModel" cannot be deleted Warning!rmdir(generated/code/Magento/Catalog/Model/ResourceModel): Directory not empty The directory "generated/code/Magento/Catalog/Ui/DataProvider" cannot be deleted Warning!rmdir(generated/code/Magento/Catalog/Ui/DataProvider): Directory not empty The directory "generated/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext" cannot be deleted Warning!rmdir(generated/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext): Directory not empty The directory "generated/code/Magento/Directory/Helper" cannot be deleted Warning!rmdir(generated/code/Magento/Directory/Helper): Directory not empty The directory "generated/code/Magento/Eav/Model/Adminhtml/System/Config" cannot be deleted Warning!rmdir(generated/code/Magento/Eav/Model/Adminhtml/System/Config): Directory not empty The directory "generated/code/Magento/Framework/App/Config" cannot be deleted Warning!rmdir(generated/code/Magento/Framework/App/Config): Directory not empty The directory "generated/code/Magento/Framework/Data/Argument" cannot be deleted Warning!rmdir(generated/code/Magento/Framework/Data/Argument): Directory not empty The directory "generated/code/Magento/Framework/Event/Config" cannot be deleted Warning!rmdir(generated/code/Magento/Framework/Event/Config): Directory not empty The directory "generated/code/Magento/Framework/ObjectManager/Config/Reader" cannot be deleted Warning!rmdir(generated/code/Magento/Framework/ObjectManager/Config/Reader): Directory not empty The directory "generated/code/Magento/Framework/Session/Config" cannot be deleted Warning!rmdir(generated/code/Magento/Framework/Session/Config): Directory not empty The directory "generated/code/Magento/Swatches/Block/Adminhtml/Product/Attribute" cannot be deleted Warning!rmdir(generated/code/Magento/Swatches/Block/Adminhtml/Product/Attribute): Directory not empty The directory "generated/code/Magento/Ui/Config" cannot be deleted Warning!rmdir(generated/code/Magento/Ui/Config): Directory not empty

Any one can help me for this. I have already set write/read all permission.

8
  • delete your generated folder and try it will work
    – MageLerner
    Oct 14, 2019 at 8:14
  • do you means generated root folder or var/generated folder..? Oct 14, 2019 at 8:16
  • var/generated folder
    – MageLerner
    Oct 14, 2019 at 8:16
  • inside var folder not have any generated folder. Oct 14, 2019 at 8:18
  • sorry you are using mage2.3 ver so you should delete root generated folder.But make sure don't delete .htaccess inside this folder
    – MageLerner
    Oct 14, 2019 at 8:19

3 Answers 3

1

Try below steps:-

sudo rm -rf var/*
sudo rm -rf pub/static/frontend/*
sudo rm -rf generated/*

sudo chmod -R 777 /var/www/html/(project name)/
sudo php bin/magento setup:upgrade
sudo php bin/magento setup:static-content:deploy -f
sudo php bin/magento ca:cl
sudo php bin/magento ca:fl
sudo chmod -R 777 /var/www/html/(project name)/

Hope this will help you..!

2
  • delete your generated a folder and then try to upgrade command
    – Devidas
    Oct 14, 2019 at 8:23
  • Not working..CSS/JS is not load on frontend/backend Oct 14, 2019 at 12:07
1

When using windows and you have installed GIT then you have a option to run some linux command over windows using GIT BASH

Open GIT BASH using right click from your root folder and try to run below command

 rm -rf var/*
 rm -rf pub/static/frontend/*
 rm -rf generated/code/*

 chmod -R 777 /var/www/html/(project name)/
 php bin/magento setup:upgrade
 php bin/magento setup:static-content:deploy -f
 php bin/magento ca:cl
 php bin/magento ca:fl
 chmod -R 777 /var/www/html/(project name)/

CSS/JS is not load on frontend/backend

for this check pub folder .htacess files and find the code like IfVersion and delete.

2
  • Not working..CSS/JS is not load on frontend/backend Oct 14, 2019 at 12:07
  • updated answer please check.
    – Zahirabbas
    Oct 16, 2019 at 14:29
0

The command 'del' or 'rmdir' will remove the recursive directories based on your OS edition.

Ref: https://superuser.com/questions/179660/how-to-recursively-delete-directory-from-command-line-in-windows

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.