I am getting the following error while running the bin/magento setup:di:compile command using a linux VM(Laravel Homestead) in a windows host.

The directory "/var/www/projectname/generated/code/Composer/Console" cannot be deleted 
Warning! rmdir(/var/www/projectname/generated/code/Composer/Console): Text file busy

How do I fix it? I have tried changing the syslink option to copy in the di.xml (app/etc/di.xml) but the error is still there.

I am also getting a similar error while changing to the developer mode

The directory "/var/www/projectname/var/cache/mage--0" cannot be deleted 
Warning! rmdir(/var/www/projectname/var/cache/mage--0): Text file busy
  • Hi Sreejith, Did you resolve this issue, I am getting the same issue on host windows 10 and running ubuntu as guest os. I am running command setup:di:compile and getting same error "Text file busy". I think it's related to shared folder. If you have resolved it please tell me. Thanks – Lak-Solve-hay May 1 at 6:25
  • This problem happen when I was using Homestead on windows 10. It has something to do with the file permission of the auto generated code. I tried different methods, but none of it was successful so I moved the magento installation to a non shared folder in Homestead. – Sreejith Sasidharan May 1 at 9:33

I am having almost the same problem with host: Windows 7 and Guest: Ubuntu 19.10. Wordpress works OK but Magento has no CSS or Javascript and I can't decompile or deploy static content, I just get a load of errors like:

The Directory "/var/www/html/generated/..." cannot be deleted Warning!rmdir(var/www/html/generated/...): Text file busy

The closest guess I can make is that Windows is not allowing permissions on the files despite me giving them.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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