我在这里开发了一个laravel包下载链接https://packagist.org/packages/dcyilmaz/livewiredatatable 源代码在这里https://github.com/duran004/livewiredatatable(不是广告,我需要分享来解决我的问题)
安装完软件包后,如果我说composer install,在Windows上没有问题。效果很好。但它在 github actions 或 docker 上给出了这个错误:
docker-compose up -d --build
[+] Building 0.0s (0/0) docker:default
2024/07/16 01:51:22 http2: server: error reading preface from client //./pipe/docker_engine: file has already been close[+] Building 8.0s (13/13) FINISHED docker:default
=> [php internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.14kB 0.0s
=> [php internal] load metadata for docker.io/library/php:8.2-fpm 0.6s
=> [php internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [php 1/9] FROM docker.io/library/php:8.2-fpm@sha256:89c7718d5465a8ad11373e79956f7b75b09d66851e26a1064cbc0708f 0.0s
=> [php internal] load build context 0.2s
=> => transferring context: 460.90kB 0.2s
=> CACHED [php 2/9] WORKDIR /var/www/html 0.0s
=> CACHED [php 3/9] RUN apt-get update && apt-get install -y libzip-dev zip unzip git cu 0.0s
=> CACHED [php 4/9] RUN chmod -R 777 /var/www/html && chown -R www-data:www-data /var/www/html 0.0s
=> CACHED [php 5/9] RUN rm -f /var/www/html/composer.lock 0.0s
=> [php 6/9] RUN rm -f /var/www/html/bootstrap/cache/*.php 0.4s
=> [php 7/9] RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=com 1.7s
=> [php 8/9] COPY . . 0.4s
=> ERROR [php 9/9] RUN composer install 4.7s
------
> [php 9/9] RUN composer install:
0.341 Installing dependencies from lock file (including require-dev)
0.346 Verifying lock file contents can be installed on current platform.
0.364 Package operations: 131 installs, 0 updates, 0 removals
0.365 - Downloading symfony/finder (v7.1.1)
0.366 - Downloading symfony/polyfill-mbstring (v1.30.0)
0.366 - Downloading symfony/var-dumper (v7.1.2)
0.367 - Downloading psr/log (3.0.0)
0.367 - Downloading maximebf/debugbar (v1.22.3)
0.367 - Downloading voku/portable-ascii (2.0.1)
0.367 - Downloading symfony/polyfill-php80 (v1.30.0)
0.368 - Downloading symfony/polyfill-ctype (v1.30.0)
0.368 - Downloading phpoption/phpoption (1.9.2)
0.368 - Downloading graham-campbell/result-type (v1.1.2)
0.369 - Downloading vlucas/phpdotenv (v5.6.0)
0.369 - Downloading symfony/css-selector (v7.1.1)
0.369 - Downloading tijsverkoyen/css-to-inline-styles (v2.2.7)
0.369 - Downloading symfony/polyfill-uuid (v1.30.0)
0.370 - Downloading symfony/uid (v7.1.1)
0.370 - Downloading symfony/deprecation-contracts (v3.5.0)
0.370 - Downloading symfony/routing (v7.1.1)
0.370 - Downloading symfony/process (v7.1.1)
0.371 - Downloading symfony/polyfill-php83 (v1.30.0)
0.371 - Downloading symfony/polyfill-php72 (v1.30.0)
0.371 - Downloading symfony/polyfill-intl-normalizer (v1.30.0)
0.371 - Downloading symfony/polyfill-intl-idn (v1.30.0)
0.372 - Downloading symfony/mime (v7.1.2)
0.372 - Downloading psr/container (2.0.2)
0.372 - Downloading symfony/service-contracts (v3.5.0)
0.372 - Downloading psr/event-dispatcher (1.0.0)
0.372 - Downloading symfony/event-dispatcher-contracts (v3.5.0)
0.373 - Downloading symfony/event-dispatcher (v7.1.1)
0.373 - Downloading doctrine/lexer (3.0.1)
0.373 - Downloading egulias/email-validator (4.0.2)
0.373 - Downloading symfony/mailer (v7.1.2)
0.374 - Downloading symfony/http-foundation (v7.1.1)
0.374 - Downloading symfony/error-handler (v7.1.2)
0.374 - Downloading symfony/http-kernel (v7.1.2)
0.374 - Downloading symfony/polyfill-intl-grapheme (v1.30.0)
0.374 - Downloading symfony/string (v7.1.2)
0.375 - Downloading symfony/console (v7.1.2)
0.375 - Downloading ramsey/collection (2.0.0)
0.375 - Downloading brick/math (0.12.1)
0.375 - Downloading ramsey/uuid (4.7.6)
0.375 - Downloading psr/simple-cache (3.0.0)
0.376 - Downloading nunomaduro/termwind (v2.0.1)
0.376 - Downloading symfony/translation-contracts (v3.5.0)
0.376 - Downloading symfony/translation (v7.1.1)
0.376 - Downloading psr/clock (1.0.0)
0.376 - Downloading symfony/clock (v7.1.1)
0.377 - Downloading carbonphp/carbon-doctrine-types (3.2.0)
0.377 - Downloading nesbot/carbon (3.6.0)
0.377 - Downloading monolog/monolog (3.7.0)
0.378 - Downloading league/mime-type-detection (1.15.0)
0.378 - Downloading league/flysystem (3.28.0)
0.378 - Downloading league/flysystem-local (3.28.0)
0.378 - Downloading nette/utils (v4.0.4)
0.378 - Downloading nette/schema (v1.3.0)
0.378 - Downloading dflydev/dot-access-data (v3.0.3)
0.379 - Downloading league/config (v1.2.0)
0.379 - Downloading league/commonmark (2.4.2)
0.379 - Downloading laravel/serializable-closure (v1.3.3)
0.379 - Downloading laravel/framework (v11.15.0)
0.379 - Downloading laravel/prompts (v0.1.24)
0.380 - Downloading guzzlehttp/uri-template (v1.0.3)
0.380 - Downloading psr/http-message (2.0)
0.380 - Downloading psr/http-client (1.0.3)
0.380 - Downloading ralouphie/getallheaders (3.0.3)
0.381 - Downloading psr/http-factory (1.1.0)
0.381 - Downloading guzzlehttp/psr7 (2.6.2)
0.381 - Downloading guzzlehttp/promises (2.0.2)
0.381 - Downloading guzzlehttp/guzzle (7.8.1)
0.381 - Downloading fruitcake/php-cors (v1.3.0)
0.382 - Downloading webmozart/assert (1.11.0)
0.382 - Downloading dragonmantank/cron-expression (v3.3.3)
0.382 - Downloading doctrine/inflector (2.0.10)
0.382 - Downloading barryvdh/laravel-debugbar (v3.13.5)
0.383 - Downloading phpstan/phpdoc-parser (1.29.1)
0.383 - Downloading phpdocumentor/reflection-common (2.2.0)
0.383 - Downloading doctrine/deprecations (1.1.3)
0.383 - Downloading phpdocumentor/type-resolver (1.8.2)
0.383 - Downloading nikic/php-parser (v5.1.0)
0.384 - Downloading composer/pcre (3.1.4)
0.384 - Downloading composer/class-map-generator (1.3.4)
0.384 - Downloading barryvdh/reflection-docblock (v2.1.1)
0.384 - Downloading barryvdh/laravel-ide-helper (v3.1.0)
0.385 - Downloading dcyilmaz/formajax (v1.0.4)
0.385 - Downloading spatie/laravel-permission (6.9.0)
0.385 - Downloading livewire/livewire (v3.5.4)
0.385 - Downloading dcyilmaz/livewiredatatable (v1.1.3)
0.386 - Downloading fakerphp/faker (v1.23.1)
0.386 - Downloading laravel/pint (v1.16.2)
0.386 - Downloading symfony/yaml (v7.1.1)
0.386 - Downloading laravel/sail (v1.30.2)
0.386 - Downloading laravel/sanctum (v4.0.2)
0.387 - Downloading laravel/telescope (v5.1.1)
0.387 - Downloading psy/psysh (v0.12.4)
0.387 - Downloading laravel/tinker (v2.9.0)
0.387 - Downloading hamcrest/hamcrest-php (v2.0.1)
0.388 - Downloading mockery/mockery (1.6.12)
0.388 - Downloading filp/whoops (2.15.4)
0.388 - Downloading nunomaduro/collision (v8.1.1)
0.388 - Downloading sebastian/version (4.0.1)
0.388 - Downloading sebastian/type (4.0.0)
0.389 - Downloading sebastian/recursion-context (5.0.0)
0.389 - Downloading sebastian/object-reflector (3.0.0)
0.389 - Downloading sebastian/object-enumerator (5.0.0)
0.389 - Downloading sebastian/global-state (6.0.2)
0.389 - Downloading sebastian/exporter (5.1.2)
0.390 - Downloading sebastian/environment (6.1.0)
0.390 - Downloading sebastian/diff (5.1.1)
0.390 - Downloading sebastian/comparator (5.0.1)
0.390 - Downloading sebastian/code-unit (2.0.0)
0.390 - Downloading sebastian/cli-parser (2.0.1)
0.391 - Downloading phpunit/php-timer (6.0.0)
0.391 - Downloading phpunit/php-text-template (3.0.1)
0.391 - Downloading phpunit/php-invoker (4.0.0)
0.391 - Downloading phpunit/php-file-iterator (4.1.0)
0.392 - Downloading theseer/tokenizer (1.2.3)
0.392 - Downloading sebastian/lines-of-code (2.0.2)
0.392 - Downloading sebastian/complexity (3.2.0)
0.392 - Downloading sebastian/code-unit-reverse-lookup (3.0.0)
0.392 - Downloading phpunit/php-code-coverage (10.1.15)
0.392 - Downloading phar-io/version (3.2.1)
0.393 - Downloading phar-io/manifest (2.0.4)
0.393 - Downloading myclabs/deep-copy (1.12.0)
0.393 - Downloading phpunit/phpunit (10.5.27)
0.393 - Downloading spatie/error-solutions (1.0.5)
0.393 - Downloading spatie/backtrace (1.6.1)
0.394 - Downloading spatie/flare-client-php (1.7.0)
0.394 - Downloading spatie/ignition (1.15.0)
0.394 - Downloading spatie/laravel-ignition (2.8.0)
0.394 - Downloading symfony/http-client-contracts (v3.5.0)
0.394 - Downloading symfony/http-client (v7.1.2)
0.395 - Downloading symfony/mailgun-mailer (v7.1.2)
0.411 0/131 [>---------------------------] 0%
1.209 16/131 [===>------------------------] 12%
1.442 28/131 [=====>----------------------] 21%
1.646 41/131 [========>-------------------] 31%
1.858 54/131 [===========>----------------] 41%
2.180 72/131 [===============>------------] 54%
2.383 83/131 [=================>----------] 63%
2.583 93/131 [===================>--------] 70%
2.896 111/131 [=======================>----] 84%
3.107 121/131 [=========================>--] 92%
3.338 131/131 [============================] 100%
3.338 - Installing symfony/finder (v7.1.1): Extracting archive
3.341 - Installing symfony/polyfill-mbstring (v1.30.0): Extracting archive
3.342 - Installing symfony/var-dumper (v7.1.2): Extracting archive
3.343 - Installing psr/log (3.0.0): Extracting archive
3.344 - Installing maximebf/debugbar (v1.22.3): Extracting archive
3.346 - Installing voku/portable-ascii (2.0.1): Extracting archive
3.347 - Installing symfony/polyfill-php80 (v1.30.0): Extracting archive
3.348 - Installing symfony/polyfill-ctype (v1.30.0): Extracting archive
3.349 - Installing phpoption/phpoption (1.9.2): Extracting archive
3.351 - Installing graham-campbell/result-type (v1.1.2): Extracting archive
3.352 - Installing vlucas/phpdotenv (v5.6.0): Extracting archive
3.352 - Installing symfony/css-selector (v7.1.1): Extracting archive
3.353 - Installing tijsverkoyen/css-to-inline-styles (v2.2.7): Extracting archive
3.353 - Installing symfony/polyfill-uuid (v1.30.0): Extracting archive
3.354 - Installing symfony/uid (v7.1.1): Extracting archive
3.354 - Installing symfony/deprecation-contracts (v3.5.0): Extracting archive
3.354 - Installing symfony/routing (v7.1.1): Extracting archive
3.355 - Installing symfony/process (v7.1.1): Extracting archive
3.355 - Installing symfony/polyfill-php83 (v1.30.0): Extracting archive
3.355 - Installing symfony/polyfill-php72 (v1.30.0): Extracting archive
3.356 - Installing symfony/polyfill-intl-normalizer (v1.30.0): Extracting archive
3.356 - Installing symfony/polyfill-intl-idn (v1.30.0): Extracting archive
3.356 - Installing symfony/mime (v7.1.2): Extracting archive
3.357 - Installing psr/container (2.0.2): Extracting archive
3.357 - Installing symfony/service-contracts (v3.5.0): Extracting archive
3.357 - Installing psr/event-dispatcher (1.0.0): Extracting archive
3.358 - Installing symfony/event-dispatcher-contracts (v3.5.0): Extracting archive
3.358 - Installing symfony/event-dispatcher (v7.1.1): Extracting archive
3.358 - Installing doctrine/lexer (3.0.1): Extracting archive
3.358 - Installing egulias/email-validator (4.0.2): Extracting archive
3.359 - Installing symfony/mailer (v7.1.2): Extracting archive
3.359 - Installing symfony/http-foundation (v7.1.1): Extracting archive
3.359 - Installing symfony/error-handler (v7.1.2): Extracting archive
3.360 - Installing symfony/http-kernel (v7.1.2): Extracting archive
3.360 - Installing symfony/polyfill-intl-grapheme (v1.30.0): Extracting archive
3.360 - Installing symfony/string (v7.1.2): Extracting archive
3.360 - Installing symfony/console (v7.1.2): Extracting archive
3.361 - Installing ramsey/collection (2.0.0): Extracting archive
3.361 - Installing brick/math (0.12.1): Extracting archive
3.361 - Installing ramsey/uuid (4.7.6): Extracting archive
3.362 - Installing psr/simple-cache (3.0.0): Extracting archive
3.362 - Installing nunomaduro/termwind (v2.0.1): Extracting archive
3.362 - Installing symfony/translation-contracts (v3.5.0): Extracting archive
3.362 - Installing symfony/translation (v7.1.1): Extracting archive
3.363 - Installing psr/clock (1.0.0): Extracting archive
3.363 - Installing symfony/clock (v7.1.1): Extracting archive
3.363 - Installing carbonphp/carbon-doctrine-types (3.2.0): Extracting archive
3.364 - Installing nesbot/carbon (3.6.0): Extracting archive
3.364 - Installing monolog/monolog (3.7.0): Extracting archive
3.364 - Installing league/mime-type-detection (1.15.0): Extracting archive
3.364 - Installing league/flysystem (3.28.0): Extracting archive
3.365 - Installing league/flysystem-local (3.28.0): Extracting archive
3.365 - Installing nette/utils (v4.0.4): Extracting archive
3.365 - Installing nette/schema (v1.3.0): Extracting archive
3.366 - Installing dflydev/dot-access-data (v3.0.3): Extracting archive
3.366 - Installing league/config (v1.2.0): Extracting archive
3.366 - Installing league/commonmark (2.4.2): Extracting archive
3.366 - Installing laravel/serializable-closure (v1.3.3): Extracting archive
3.367 - Installing laravel/framework (v11.15.0): Extracting archive
3.367 - Installing laravel/prompts (v0.1.24): Extracting archive
3.367 - Installing guzzlehttp/uri-template (v1.0.3): Extracting archive
3.368 - Installing psr/http-message (2.0): Extracting archive
3.368 - Installing psr/http-client (1.0.3): Extracting archive
3.368 - Installing ralouphie/getallheaders (3.0.3): Extracting archive
3.368 - Installing psr/http-factory (1.1.0): Extracting archive
3.369 - Installing guzzlehttp/psr7 (2.6.2): Extracting archive
3.369 - Installing guzzlehttp/promises (2.0.2): Extracting archive
3.369 - Installing guzzlehttp/guzzle (7.8.1): Extracting archive
3.369 - Installing fruitcake/php-cors (v1.3.0): Extracting archive
3.370 - Installing webmozart/assert (1.11.0): Extracting archive
3.370 - Installing dragonmantank/cron-expression (v3.3.3): Extracting archive
3.370 - Installing doctrine/inflector (2.0.10): Extracting archive
3.371 - Installing barryvdh/laravel-debugbar (v3.13.5): Extracting archive
3.371 - Installing phpstan/phpdoc-parser (1.29.1): Extracting archive
3.371 - Installing phpdocumentor/reflection-common (2.2.0): Extracting archive
3.371 - Installing doctrine/deprecations (1.1.3): Extracting archive
3.372 - Installing phpdocumentor/type-resolver (1.8.2): Extracting archive
3.372 - Installing nikic/php-parser (v5.1.0): Extracting archive
3.372 - Installing composer/pcre (3.1.4): Extracting archive
3.373 - Installing composer/class-map-generator (1.3.4): Extracting archive
3.373 - Installing barryvdh/reflection-docblock (v2.1.1): Extracting archive
3.373 - Installing barryvdh/laravel-ide-helper (v3.1.0): Extracting archive
3.373 - Installing dcyilmaz/formajax (v1.0.4): Extracting archive
3.374 - Installing spatie/laravel-permission (6.9.0): Extracting archive
3.374 - Installing livewire/livewire (v3.5.4): Extracting archive
3.374 - Installing dcyilmaz/livewiredatatable (v1.1.3): Extracting archive
3.374 - Installing fakerphp/faker (v1.23.1): Extracting archive
3.375 - Installing laravel/pint (v1.16.2): Extracting archive
3.375 - Installing symfony/yaml (v7.1.1): Extracting archive
3.375 - Installing laravel/sail (v1.30.2): Extracting archive
3.376 - Installing laravel/sanctum (v4.0.2): Extracting archive
3.376 - Installing laravel/telescope (v5.1.1): Extracting archive
3.376 - Installing psy/psysh (v0.12.4): Extracting archive
3.376 - Installing laravel/tinker (v2.9.0): Extracting archive
3.377 - Installing hamcrest/hamcrest-php (v2.0.1): Extracting archive
3.377 - Installing mockery/mockery (1.6.12): Extracting archive
3.377 - Installing filp/whoops (2.15.4): Extracting archive
3.378 - Installing nunomaduro/collision (v8.1.1): Extracting archive
3.378 - Installing sebastian/version (4.0.1): Extracting archive
3.378 - Installing sebastian/type (4.0.0): Extracting archive
3.378 - Installing sebastian/recursion-context (5.0.0): Extracting archive
3.379 - Installing sebastian/object-reflector (3.0.0): Extracting archive
3.379 - Installing sebastian/object-enumerator (5.0.0): Extracting archive
3.379 - Installing sebastian/global-state (6.0.2): Extracting archive
3.380 - Installing sebastian/exporter (5.1.2): Extracting archive
3.380 - Installing sebastian/environment (6.1.0): Extracting archive
3.380 - Installing sebastian/diff (5.1.1): Extracting archive
3.381 - Installing sebastian/comparator (5.0.1): Extracting archive
3.381 - Installing sebastian/code-unit (2.0.0): Extracting archive
3.381 - Installing sebastian/cli-parser (2.0.1): Extracting archive
3.381 - Installing phpunit/php-timer (6.0.0): Extracting archive
3.382 - Installing phpunit/php-text-template (3.0.1): Extracting archive
3.382 - Installing phpunit/php-invoker (4.0.0): Extracting archive
3.382 - Installing phpunit/php-file-iterator (4.1.0): Extracting archive
3.382 - Installing theseer/tokenizer (1.2.3): Extracting archive
3.383 - Installing sebastian/lines-of-code (2.0.2): Extracting archive
3.383 - Installing sebastian/complexity (3.2.0): Extracting archive
3.383 - Installing sebastian/code-unit-reverse-lookup (3.0.0): Extracting archive
3.383 - Installing phpunit/php-code-coverage (10.1.15): Extracting archive
3.384 - Installing phar-io/version (3.2.1): Extracting archive
3.384 - Installing phar-io/manifest (2.0.4): Extracting archive
3.384 - Installing myclabs/deep-copy (1.12.0): Extracting archive
3.384 - Installing phpunit/phpunit (10.5.27): Extracting archive
3.385 - Installing spatie/error-solutions (1.0.5): Extracting archive
3.385 - Installing spatie/backtrace (1.6.1): Extracting archive
3.385 - Installing spatie/flare-client-php (1.7.0): Extracting archive
3.385 - Installing spatie/ignition (1.15.0): Extracting archive
3.386 - Installing spatie/laravel-ignition (2.8.0): Extracting archive
3.386 - Installing symfony/http-client-contracts (v3.5.0): Extracting archive
3.386 - Installing symfony/http-client (v7.1.2): Extracting archive
3.386 - Installing symfony/mailgun-mailer (v7.1.2): Extracting archive
3.398 0/131 [>---------------------------] 0%
3.521 40/131 [========>-------------------] 30%
3.632 64/131 [=============>--------------] 48%
3.736 84/131 [=================>----------] 64%
3.840 101/131 [=====================>------] 77%
3.954 120/131 [=========================>--] 91%
4.016 131/131 [============================] 100%
4.202 Generating autoload files
4.471 > Illuminate\Foundation\ComposerScripts::postAutoloadDump
4.480 > @php artisan package:discover --ansi
4.575
4.581 In ProviderRepository.php line 206:
4.581
4.581 Class "Dcyilmaz\LivewireDataTable\LivewireDataTableServiceProvider" not fou
4.581 nd
4.581
4.581
4.585 Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
------
failed to solve: process "/bin/sh -c composer install" did not complete successfully: exit code: 1
在 Laravel 11 中,我的提供程序在 bootstrap/providers.php 中像这样注册。
<?php
return [
App\Providers\AppServiceProvider::class,
Spatie\Permission\PermissionServiceProvider::class,
Dcyilmaz\LivewireDataTable\LivewireDataTableServiceProvider::class,
];
如果我使用composer删除dcyilmaz/livewiredatatable删除我的包,我的docker容器就会创建。所以我认为docker部分没有问题。我的包裹里有。我哪里做错了?
我尝试过的:
虽然 Dcyilmaz\LivewireDataTable\LivewireDataTable\LivewireDataTableServiceProvider::class 附加在 bootstrap/providers.php 中,但我预计“Dcyilmaz\LivewireDataTable\LivewireDataTable\LivewireDataTableServiceProvider::class not found”错误。
也要注意大小写。
class LivewireDatatableServiceProvider extends ServiceProvider
class LivewireDataTableServiceProvider extends ServiceProvider
Windows 和 Mac 不区分大小写。 Linux 区分大小写。这种差异只会在 Linux 上导致错误。