laravel 脚本 php artisan package:discover 处理返回的 post-autoload-dump 事件,错误代码为 -1073740791

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/52972822/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 18:08:06  来源:igfitidea点击:

Script php artisan package:discover handling the post-autoload-dump event returned with error code -1073740791

phplaravellaravel-5composer-php

提问by Recognizer

Why is it throwing an error? What can I do to debug the issue?

为什么会抛出错误?我可以做些什么来调试问题?

Composer version 1.7.2 2018-08-16 16:57:12 Running on Windows 10.

Composer 版本 1.7.2 2018-08-16 16:57:12 在 Windows 10 上运行。

I can run php artisan package:discover manually without issue. I'm not sure what the number at the end means. I ran this with composer update -vvv

我可以手动运行 php artisan package:discover 没有问题。我不确定最后的数字是什么意思。我用 composer update -vvv 运行了这个

Writing lock file
Generating optimized autoload files
> post-autoload-dump: Illuminate\Foundation\ComposerScripts::postAutoloadDump
> post-autoload-dump: php artisan package:discover
Executing command (CWD): php artisan package:discover
Script php artisan package:discover handling the post-autoload-dump event returned with error code -1073740791

采纳答案by Recognizer

So it looks like the issue was due to having multiple versions of php and copy and paste. Likely the version of php that composer was using had the extension folder point to a different version's extension folder.

所以看起来这个问题是由于有多个版本的 php 以及复制和粘贴。很可能作曲家使用的 php 版本的扩展文件夹指向不同版本的扩展文件夹。

If I had properly installed the different versions, I would not have gotten the issue.

如果我正确安装了不同的版本,我就不会遇到这个问题。

Removal of all unused php versions and the reinstall of composer has fixed this issue.

删除所有未使用的 php 版本并重新安装 Composer 已解决此问题。