简体   繁体   English

Laravel 7 - php 工匠供应商:发布未正确列出

[英]Laravel 7 - php artisan vendor:publish not listing correctly

During the process of updating to Laravel 7 I added a couple of extra packages into the composer.json file (under "require" and "require-dev" that are listed in the composer.json file of the Laravel 7 depository on Github but were not added/installed when I ran composer update with the Laravel version on composer.json updated. During the process of updating to Laravel 7 I added a couple of extra packages into the composer.json file (under "require" and "require-dev" that are listed in the composer.json file of the Laravel 7 depository on Github but were当我在 composer.json 上使用 Laravel 版本运行composer update时未添加/安装。

I then ran php artisan vendor:list to list which providers still required publishing.然后我运行php artisan vendor:list列出哪些提供商仍需要发布。 The aforementioned packages were indeed listed, however, so was every other package that I have installed (a total of 16 providers and tags.) Rather than giving me the option of pressing 0-16 which provider/tag I wished to publish (zero for all), the operation simply aborted after listing them.但是,确实列出了上述软件包,但是,我安装的所有其他package (总共 16 个提供程序和标签)也是如此。而不是让我选择按 0-16 我希望发布的提供程序/标签(零all),操作在列出它们后简单地中止

I then went though the new packages by specifying them specifically - for example php artisan vendor:publish --provider="Facade\Ignition\IgnitionServiceProvider" - and they were then published successfully.然后,我通过专门指定它们来浏览新包 - 例如php artisan vendor:publish --provider="Facade\Ignition\IgnitionServiceProvider" - 然后它们被成功发布。

I then ran php artisan vendor:publish again and, sure enough, everything I have ever published (including the new packages that were now successfully published) appeared on the list and the operation was aborted once again.然后我再次运行php artisan vendor:publish ,果然,我曾经发布的所有内容(包括现在成功发布的新包)都出现在列表中,操作再次中止。

In order to get the php artisan vendor:publish command to work (without having to specify the provider specifically) I have:为了让php artisan vendor:publish命令正常工作(无需具体指定提供者),我有:

  1. Added --force添加了--force
  2. Emptied the cache php artisan cache:clear清空缓存php 工匠缓存:清除
  3. Emptied the config php artisan config:clear清空配置php artisan config:clear
  4. Added a couple of the packages to the list of providers in app.config to see if it would stop they would disappear from the vendor:publish list.在 app.config 中的提供者列表中添加了几个包,以查看它是否会停止它们会从 vendor:publish 列表中消失。

The command still will still not work...该命令仍然无法正常工作......

EDIT Below is the full aborted error response:编辑下面是完整的中止错误响应:

[2020-12-16 01:17:01] local.ERROR: Aborted. [2020-12-16 01:17:01] local.ERROR:中止。 {"exception":"[object] (Symfony\Component\Console\Exception\MissingInputException(code: 0): Aborted. at C:\Users\james\Documents\outletdeviviendas\api\vendor\symfony\console\Helper\QuestionHelper.php:128) [stacktrace] #0 C:\Users\james\Documents\outletdeviviendas\api\vendor\symfony\console\Helper\QuestionHelper.php(67): Symfony\Component\Console\Helper\QuestionHelper->doAsk(Object(Illuminate\Console\OutputStyle), Object(Symfony\Component\Console\Question\ChoiceQuestion)) #1 C:\Users\james\Documents\outletdeviviendas\api\vendor\symfony\console\Helper\QuestionHelper.php(470): Symfony\Component\Console\Helper\QuestionHelper->Symfony\Component\Console\Helper\{closure}() #2 C:\Users\james\Documents\outletdeviviendas\api\vendor\symfony\console\Helper\QuestionHelper.php(70): Symfony\Component\Console\Helper\QuestionHelper->validateA {"exception":"[object] (Symfony\Component\Console\Exception\MissingInputException(code: 0): Aborted. at C:\Users\james\Documents\outletdeviviendas\api\vendor\symfony\console\Helper\QuestionHelper .php:128) [stacktrace] #0 C:\Users\james\Documents\outletdeviviendas\api\vendor\symfony\console\Helper\QuestionHelper.php(67): Symfony\Component\Console\Helper\QuestionHelper->doAsk (对象(Illuminate\Console\OutputStyle),对象(Symfony\Component\Console\Question\ChoiceQuestion))#1 C:\Users\james\Documents\outletdeviviendas\api\vendor\symfony\console\Helper\QuestionHelper.php( 470): Symfony\Component\Console\Helper\QuestionHelper->Symfony\Component\Console\Helper\{closure}() #2 C:\Users\james\Documents\outletdeviviendas\api\vendor\symfony\console\Helper\ QuestionHelper.php(70): Symfony\Component\Console\Helper\QuestionHelper->validateA ttempts(Object(Closure), Object(Illuminate\Console\OutputStyle), Object(Symfony\Component\Console\Question\ChoiceQuestion)) #3 C:\Users\james\Documents\outletdeviviendas\api\vendor\symfony\console\Style\SymfonyStyle.php(355): Symfony\Component\Console\Helper\QuestionHelper->ask(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle), Object(Symfony\Component\Console\Question\ChoiceQuestion)) #4 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Console\Concerns\InteractsWithIO.php(211): Symfony\Component\Console\Style\SymfonyStyle->askQuestion(Object(Symfony\Component\Console\Question\ChoiceQuestion)) #5 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Foundation\Console\VendorPublishCommand.php(111): Illuminate\Console\Command->choice(Object(Symfony\Component\Console\Question\Choic尝试(对象(闭包),对象(照明\控制台\输出样式),对象(Symfony\组件\控制台\问题\选择问题))#3 C:\Users\james\Documents\outletdeviviendas\api\vendor\symfony\console\ Style\SymfonyStyle.php(355): Symfony\Component\Console\Helper\QuestionHelper->ask(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle), Object(Symfony\Component\ Console\Question\ChoiceQuestion)) #4 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Console\Concerns\InteractsWithIO.php(211): Symfony\Component\Console\Style \SymfonyStyle->askQuestion(对象(Symfony\Component\Console\Question\ChoiceQuestion)) #5 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Foundation\Console\VendorPublishCommand。 php(111): Illuminate\Console\Command->choice(Object(Symfony\Component\Console\Question\Choic eQuestion), Array) #6 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Foundation\Console\VendorPublishCommand.php(98): Illuminate\Foundation\Console\VendorPublishCommand->promptForProviderOrTag() #7 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Foundation\Console\VendorPublishCommand.php(73): Illuminate\Foundation\Console\VendorPublishCommand->determineWhatShouldBePublished() #8 [internal function]: Illuminate\Foundation\Console\VendorPublishCommand->handle() #9 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(37): call_user_func_array(Array, Array) #10 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Container\Util.php(37): Illuminate\Container\BoundMethod::Illuminate\Containe eQuestion), Array) #6 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Foundation\Console\VendorPublishCommand.php(98): Illuminate\Foundation\Console\VendorPublishCommand-> promptForProviderOrTag() #7 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Foundation\Console\VendorPublishCommand.php(73): Illuminate\Foundation\Console\VendorPublishCommand->determineWhatShouldBePublish ) #8 [内部函数]: Illuminate\Foundation\Console\VendorPublishCommand->handle() #9 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php (37): call_user_func_array(Array, Array) #10 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Container\Util.php(37): Illuminate\Container\BoundMethod: :照亮\遏制r\{closure}() #11 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(95): Illuminate\Container\Util::unwrapIfClosure(Object(Closure)) #12 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(39): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure)) #13 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Container\Container.php(592): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) #14 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Console\Command.php(134): Illuminate\Container\Container->call(Array) #15 C:\Users\jam r\{closure}() #11 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(95): Illuminate\Container\Util::unwrapIfClosure(对象(闭包))#12 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(39): Illuminate\Container\BoundMethod::callBoundMethod(Object( Illuminate\Foundation\Application), Array, Object(Closure)) #13 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Container\Container.php(592): Illuminate\ Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) #14 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Console\Command .php(134): Illuminate\Container\Container->call(Array) #15 C:\Users\jam es\Documents\outletdeviviendas\api\vendor\symfony\console\Command\Command.php(258): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) #16 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Console\Command.php(121): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) #17 C:\Users\james\Documents\outletdeviviendas\api\vendor\symfony\console\Application.php(911): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #18 C:\Users\james\Documents\outletdeviviendas\api\vendor\symfony\console\Application.php(264): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Foundation\Console\VendorPublishCo es\Documents\outletdeviviendas\api\vendor\symfony\console\Command\Command.php(258): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console \OutputStyle)) #16 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Console\Command.php(121): Symfony\Component\Console\Command\Command->run (对象(Symfony\Component\Console\Input\ArgvInput),对象(Illuminate\Console\OutputStyle))#17 C:\Users\james\Documents\outletdeviviendas\api\vendor\symfony\console\Application.php(911) : Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #18 C:\Users\james\Documents\outletdeviviendas\api \vendor\symfony\console\Application.php(264): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Foundation\Console\VendorPublishCo mmand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #19 C:\Users\james\Documents\outletdeviviendas\api\vendor\symfony\console\Application.php(140): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #20 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Console\Application.php(93): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #21 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(129): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput) mmand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #19 C:\Users\james\Documents\outletdeviviendas\api\vendor\symfony\console\ Application.php(140): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #20 C:\Users \james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Console\Application.php(93): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput ), Object(Symfony\Component\Console\Output\ConsoleOutput)) #21 C:\Users\james\Documents\outletdeviviendas\api\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(129) : Illuminate\Console\Application->运行(对象(Symfony\Component\Console\Input\ArgvInput),对象(Symfony\Component\Console\Output\ConsoleOutput) ) #22 C:\Users\james\Documents\outletdeviviendas\api\artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #23 {main} ) #22 C:\Users\james\Documents\outletdeviviendas\api\artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component \Console\Output\ConsoleOutput)) #23 {main}

This problem do not specify what has gone wrong so its hard to tackle.It might be helpful if you posted your log file after the crash on vendor:publish but you can check the logs for detail error report it will surely help you.这个问题没有具体说明哪里出了问题,因此很难解决。如果您在vendor:publish崩溃后发布日志文件可能会有所帮助,但您可以查看日志以获取详细的错误报告,它肯定会对您有所帮助。 The logs are located in storage directory.日志位于storage目录中。 If you want laravel to display complete error for you rather than the cryptic 'Whoops' message, make sure in your .env APP_ENV=local is in there and your APP_DEBUG=true or you can tweak it in your config/app.php like如果您希望 laravel 为您显示完整的错误而不是神秘'Whoops'消息,请确保在您的.env APP_ENV=local中并且您的APP_DEBUG=true或者您可以在config/app.php中对其进行调整

'env' => env('APP_ENV', 'local'),
'debug' => env('APP_DEBUG', true),

Also try deleteing packages.php, services.php, config.php manually from bootstrap folder and then try composer dump-autoload or installing the packages again via composer install by deleting vendor folder.还尝试从bootstrap文件夹中手动删除packages.php, services.php, config.php ,然后尝试通过composer dump-autoload删除vendor文件夹或再次composer install软件包。

You need to upgrade to Laravel 7 or above Run The Following command to create a Laravel project version 7需要升级到Laravel 7以上运行以下命令创建Laravel项目版本7

composer create-project --prefer-dist laravel/laravel:^7.0 Project Name

Or if you would like to upgrade without installing a new application follow the steps in the following link: https://laravel.com/docs/5.7/upgrade或者,如果您想在不安装新应用程序的情况下升级,请按照以下链接中的步骤操作: https://laravel.com/docs/5.7/upgrade

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM