【问题标题】:Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255脚本@php artisan package:discover --ansi 处理返回的自动加载转储后事件,错误代码为 255
【发布时间】:2020-05-27 23:17:59
【问题描述】:

我正在开发这个包:https://github.com/craftisan/laravel-seo 作为laravel-admin 的扩展,并且在通过 composer 将它添加到 laravel 项目中时,我收到了这个错误 (see github issue here):

% 作曲家需要 Craftisan/laravel-seo --ignore-platform-reqs 将 dev-master 版本用于 Craftisan/laravel-seo ./composer.json 已更新 使用包信息加载作曲家存储库 更新依赖项(包括 require-dev) 软件包操作:1 次安装、0 次更新、0 次删除 - 安装craftisan/laravel-seo (dev-master 96e32bc):从缓存中克隆96e32bc192 包 moontoast/math 已废弃,您应该避免使用它。改用积木/数学。 包 zendframework/zend-code 被废弃,你应该避免使用它。改用 laminas/laminas-code。 包 zendframework/zend-eventmanager 被废弃,你应该避免使用它。请改用 laminas/laminas-eventmanager。 写锁文件 生成优化的自动加载文件 > Illuminate\Foundation\ComposerScripts::postAutoloadDump > @php 工匠包:发现 --ansi 脚本@php artisan package:discover --ansi 处理返回的自动加载转储后事件,错误代码为 255 安装失败,正在将 ./composer.json 还原为其原始内容。

我尝试了很多调试,检查了配置文件语法,甚至从 artisan 中的 package:discover 命令一路转储输出,但没有找到任何东西。

storage/ & bootstrap/cache 可写
rm -rf bootstrap/cache 完成

任何想法为什么会发生这种情况?

【问题讨论】:

  • 更新您的作曲家composer update 仍然面临问题?
  • 也试过了,没用。现在修好了。

标签: laravel laravel-5 laravel-artisan laravel-admin


【解决方案1】:

已修复

在新的 laravel 应用程序中安装了相同的包。显然配置文件的相对链接已损坏,但composer install 没有给出错误跟踪。在__DIR__ 之后错过了前面的/

// Publish configuration
        $this->publishes([
            __DIR__ . '../config/seo.php' => config_path('seo.php'),
// fix: __DIR__ . '/../config/seo.php' => config_path('seo.php'),
        ], 'seo');

【讨论】:

    猜你喜欢
    • 2020-04-24
    • 1970-01-01
    • 2018-11-23
    • 2023-03-16
    • 2019-03-29
    • 2020-05-25
    • 1970-01-01
    • 2019-05-28
    • 1970-01-01
    相关资源
    最近更新 更多