【问题标题】:Unable to locate publishable resources找不到可发布的资源
【发布时间】:2020-03-17 09:10:39
【问题描述】:

我尝试过使用

发布这个包
php artisan vendor:publish --provider="BeyondCode\LaravelWebSockets\WebSocketsServiceProvider" --tag="migrations"

但我得到了

Unable to locate publishable resources

publishing complete

我不知道问题的原因是什么。任何可以帮助我的人。

安装输出

Installing beyondcode/laravel-websockets (1.4.0): Downloading (100%)
symfony/polyfill-intl-idn suggests installing ext-intl (For best performance)
symfony/psr-http-message-bridge suggests installing nyholm/psr7 (For a super lightweight PSR-7/17 implementation)
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
symfony/event-dispatcher suggests installing symfony/dependency-injection
symfony/var-dumper suggests installing ext-intl (To show region name in time zone dump)
symfony/http-kernel suggests installing symfony/browser-kit
symfony/http-kernel suggests installing symfony/config
symfony/http-kernel suggests installing symfony/dependency-injection
react/event-loop suggests installing ext-event (~1.0 for ExtEventLoop)
react/event-loop suggests installing ext-pcntl (For signal handling support when using the StreamSelectLoop)
react/event-loop suggests installing ext-uv (* for ExtUvLoop)
paragonie/sodium_compat suggests installing ext-libsodium (PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.)
paragonie/sodium_compat suggests installing ext-sodium (PHP >= 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.)
voku/portable-ascii suggests installing ext-intl (Use Intl for transliterator_transliterate() support)
symfony/translation suggests installing symfony/config
symfony/translation suggests installing symfony/yaml
illuminate/support suggests installing moontoast/math (Required to use ordered UUIDs (^1.1).)
illuminate/support suggests installing ramsey/uuid (Required to use Str::uuid() (^3.7).)
illuminate/support suggests installing vlucas/phpdotenv (Required to use the Env class and env helper (^4.0).)
symfony/routing suggests installing symfony/config (For using the all-in-one router or any loader)
symfony/routing suggests installing symfony/yaml (For using the YAML loader)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
symfony/routing suggests installing doctrine/annotations (For using the annotation loader)
illuminate/filesystem suggests installing league/flysystem (Required to use the Flysystem local and FTP drivers (^1.0).)
illuminate/filesystem suggests installing league/flysystem-aws-s3-v3 (Required to use the Flysystem S3 driver (^1.0).)
illuminate/filesystem suggests installing league/flysystem-cached-adapter (Required to use the Flysystem cache (^1.0).)
illuminate/filesystem suggests installing league/flysystem-sftp (Required to use the Flysystem SFTP driver (^1.0).)
illuminate/http suggests installing guzzlehttp/guzzle (Required to use the HTTP Client (^6.3.1|^7.0).)
illuminate/routing suggests installing nyholm/psr7 (Required to use PSR-7 bridging features (^1.2).)
symfony/service-contracts suggests installing symfony/service-implementation
symfony/console suggests installing symfony/lock
illuminate/console suggests installing dragonmantank/cron-expression (Required to use scheduler (^2.0).)
illuminate/console suggests installing guzzlehttp/guzzle (Required to use the ping methods on schedules (^6.3.1|^7.0).)
illuminate/database suggests installing doctrine/dbal (Required to rename columns and drop SQLite columns (^2.6).)
illuminate/database suggests installing fzaninotto/faker (Required to use the eloquent factory builder (^1.4).)
illuminate/database suggests installing illuminate/events (Required to use the observers with Eloquent (^7.0).)
illuminate/database suggests installing illuminate/pagination (Required to paginate the result set (^7.0).)
illuminate/queue suggests installing ext-pcntl (Required to use all features of the queue worker.)
illuminate/queue suggests installing ext-posix (Required to use all features of the queue worker.)
illuminate/queue suggests installing aws/aws-sdk-php (Required to use the SQS queue driver and DynamoDb failed job storage (^3.0).)
illuminate/queue suggests installing illuminate/redis (Required to use the Redis queue driver (^7.0).)
illuminate/queue suggests installing pda/pheanstalk (Required to use the Beanstalk queue driver (^4.0).)
guzzlehttp/psr7 suggests installing zendframework/zend-httphandlerrunner (Emit PSR-7 responses)
Writing lock file
Generating autoload files

【问题讨论】:

  • 你想将它安装到现有的 Laravel 项目中吗?你使用的是什么版本的 Laravel?您是否在 Github 上发布了 this 问题?
  • @DelenaMalan 我正在尝试将它安装在现有项目上。我的 laravel 版本是 Laravel Framework 6.18.0
  • 你能添加步骤来重现吗?从您的 github 问题来看,当您安装 laravel-websockets 时似乎没有 composer.json(它说“./composer.json 已创建”)。如果我运行 composer create-project --prefer-dist laravel/laravel laravel-test-6.8 "6.18.0" &amp;&amp; cd laravel-test-6.8 &amp;&amp; composer require beyondcode/laravel-websockets &amp;&amp; php artisan vendor:publish --provider="BeyondCode\LaravelWebSockets\WebSocketsServiceProvider" --tag="migrations" 它可以工作。
  • 谢谢我有两位作曲家,我删除了一位。我工作过。

标签: laravel laravel-websockets


【解决方案1】:
  1. 首次运行命令:

    php artisan vendor:publish
    

您将看到要发布的内容列表:


  1. 通过提供索引号来选择您要发布的内容。 如果是迁移,输入 20 回车;如果是配置文件,输入 12 并回车。

我希望这能解决您的错误。

【讨论】:

  • 是的,它可以工作,但是 --tag 参数有什么问题?
  • 我不太确定,但这将是由于版本兼容性,它可能是 composer 或 laravel 版本以及您添加到框架中的包。错误是因为框架无法找到位置源,这就是它发生的原因。
  • 太棒了。为我工作。
【解决方案2】:

这就是运行这个命令“php artisan vendor:publish --provider”,然后选择引用您要发布的文件的编号。

【讨论】:

    【解决方案3】:

    我遇到了同样的问题,现在已经解决了,看看它的样子

    执行了以下命令集:

    php artisan clear-compiled
    composer dumpautoload
    

    之后我的php artisan vendor:publish --provider="Path\To\Class" 运行成功。

    请看下面的完整截图

    This link 很有帮助。

    【讨论】:

      【解决方案4】:

      我通过运行composer update解决了它

      【讨论】:

        【解决方案5】:

        我遇到了同样的问题。但就我而言,我只是忘记在app.php 中注册包ServiceProvider

        【讨论】:

          【解决方案6】:

          尝试运行命令:

          php 工匠供应商:发布

          然后选择您要发布的包... 希望能解决你的问题。

          【讨论】:

            【解决方案7】:

            它解决了我的问题:

            php artisan config:cache
            

            然后

            php artisan vendor:publish
            

            选择提供者的号码,您就完成了。

            【讨论】:

              【解决方案8】:

              先生,我也是这个问题,我解决了:

              尝试只运行php artisan vendor:publish,你会看到所有可发布的,然后你可以根据列表的数量选择你需要的。

              【讨论】:

                【解决方案9】:

                然后在本地安装 composer 安装作曲家。

                【讨论】:

                  【解决方案10】:

                  我也遇到了同样的问题。所以我关闭了命令终端并重试。它的工作。

                  【讨论】:

                    【解决方案11】:

                    我也遇到过同样的问题, 我尝试了所有解决方案,但都没有奏效..

                    我只是忘了第一次运行:composer require laravel/sanctum

                    在那之后,我不得不跑:composer update 之后我能够执行:php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"

                    【讨论】:

                      【解决方案12】:

                      我在 Docker 容器中使用 Laravel,所以我创建了 BASH 脚本来从任何地方调用“php artisan”,这个脚本只是切断了 artisan 命令的双引号(“)。当在 docker 容器中手动运行时,它就可以工作了正如预期的那样。

                      【讨论】:

                        猜你喜欢
                        • 1970-01-01
                        • 2021-05-04
                        • 2012-08-17
                        • 2020-11-29
                        • 1970-01-01
                        • 2015-09-17
                        • 1970-01-01
                        • 2017-12-23
                        • 1970-01-01
                        相关资源
                        最近更新 更多