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