执行 Composer dumpautoload 命令时出错?
我装了winnfsd插件提高网页的访问速度。网上找到的答案如下:
I can confirm this problem, multiple of our developers faced it within the last weeks. Sometimes we could solve it by deleting the autoload_classmap.php file, sometimes by reloading Vagrant, sometimes we couldn't get it working at all. It's not a Laravel problem, it's caused by Vagrant on Windows, specifically by the winnfsd/vagrant-winnfsd plugin. The file_put_contents in src/Composer/Autoload/AutoloadGenerator.php:273 mentioned by @jural does actually work, it returns the number of written bytes like expected. However, the file is still empty after the write operation finishes. This confirms the whole problem being related to the underlying file system. If you configure composer to keep the vendor dir outside of the scope managed by winnfsd ("vendor-dir": "~/composer/"), everything works fine. The winnfsd plugin is known for being quite buggy in general, so I don't think something in composer can be done to solve this problem.
我可以确认这个问题,我们的开发人员在过去几周内遇到了这个问题。有时我们可以通过删除autoload_classmap.php文件来解决它,有时通过重新加载Vagrant,有时我们根本无法使它工作。这不是Laravel问题,它是由Windows上的Vagrant引起的,特别是由winnfsd / vagrant-winnfsd插件引起的。将file_put_contents在src/Composer/Autoload/AutoloadGenerator.php:273通过提到@jural实际上做的工作,它返回写入的字节数像预期。但是,写操作完成后,文件仍为空。这确认了与底层文件系统相关的整个问题。如果配置composer以使供应商目录保持在winnfsd管理的范围之外("vendor-dir": "~/composer/"),一切正常。winnfsd插件一般都是非常有用的,所以我不认为在composer中可以做些什么来解决这个问题。
推荐文章: