Laravel 7-PHP Artisan Supplier:发布未正确列出 [英] Laravel 7 - php artisan vendor:publish not listing correctly

查看:84
本文介绍了Laravel 7-PHP Artisan Supplier:发布未正确列出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在更新为Laravel 7的过程中,我在composer中列出的 composer.json 文件中(在"require"和"require-dev"下)添加了两个额外的软件包.Github上Laravel 7存放区的.json文件,但是当我运行 composer update 且composer.json上的Laravel版本已更新时,未添加/安装.

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.

然后我运行了 php artisan vendor:list 以列出仍需要发布的提供商.确实列出了上述软件包,但是我安装的所有其他软件包也列出了(总共16个提供程序和标记.)而不是让我选择按0-16,选择哪个提供程序/标记我希望发布(全部为零),该操作在列出它们后会中止.

I then ran php artisan vendor:list to list which providers still required publishing. 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.

然后,我通过具体指定新软件包来查看这些新软件包-例如 php artisan vendor:publish --provider ="Facade \ Ignition \ IgnitionServiceProvider" -然后成功发布了它们.

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 ,而且肯定的是,我曾经发布的所有内容(包括现已成功发布的新软件包)都出现在列表上,并且该操作一次中止了再次.

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:

  1. 添加了-force
  2. 清空了缓存 php artisan cache:clear
  3. 使用了配置 php artisan config:clear
  4. 在app.config中的提供程序列表中添加了两个软件包,以查看它们是否将停止从供应商:发布列表中消失.

该命令仍然无法使用...

The command still will still not work...

编辑以下是完全中止的错误响应:

EDIT Below is the full aborted error response:

[2020-12-16 01:17:01]本地.错误:已中止.{"exception":" [object](Symfony \ Component \ Console \ Exception \ MissingInputException(代码:0):在C:\ Users \ james \ Documents \ outletdeviviendas \ api \ vendor \ symfony \ console \ Helper中中止.\ QuestionHelper.php:128)[堆栈跟踪]#0 C:\ Users \ james \ Documents \ outletdeviviendas \ api \ vendor \ symfony \ console \ Helper \ QuestionHelper.php(67):Symfony \ Component \ Console \ Helper \ QuestionHelper-> doAsk(Object(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 \{关闭}()#2 C:\ Users \ james \ Documents \ outletdeviviendas \ api \ vendor \ symfony \ console \ Helper \ QuestionHelper.php(70):Symfony \ Component \ Console \ Helper \ QuestionHelper-> validateAttempts(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 \控制台\输入\ ArgvInput),对象(Illuminate \控制台\ OutputStyle),对象(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 \ ChoiceQuestion),数组)#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-> determineWhatShouuldBePublished()#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 :: Illuminate \ Container \ {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),数组,对象(关闭)#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 \ james \ Documents \ outletdeviviendas \ api \ vendor \ symfony \ console \ Command \ Command.php(258):Illuminate \ Console \ Command-> execute(Object(Symfony \ Component \ Console \ Input \ArgvInput),对象(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),对象(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 \ VendorPublishCommand),对象(Symfony \ Component \ Console \ Input \ ArgvInput),对象(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),对象(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),对象(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),对象(Symfony \ Component \ Console \ Output \ ConsoleOutput)#22 C:\ Users \ james \ Documents \ outletdeviviendas \ api \ artisan(37):Illuminate \ Foundation \ Console \ Kernel->句柄(Object(Symfony \ Component \ Console \ Input \ ArgvInput),Object(Symfony \ Component\ Console \ Output \ ConsoleOutput))#23 {main}

[2020-12-16 01:17:01] local.ERROR: Aborted. {"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->validateAttempts(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\ChoiceQuestion), 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\Container\{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\james\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\VendorPublishCommand), 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)) #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}

推荐答案

此问题未指明出了什么问题,因此很难解决.如果您在崩溃后将日志文件发布到 vendor上,可能会有所帮助:publish ,但您可以查看日志以获取详细的错误报告,它一定会对您有所帮助.日志位于 storage 目录中.如果您希望laravel为您显示完整的错误,而不是神秘的'Whoops'消息,请确保您的 .env APP_ENV = local 在其中,然后输入 APP_DEBUG = true ,也可以在 config/app.php 中对其进行调整,例如

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. The logs are located in storage directory. 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

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

也可以尝试从 bootstrap 文件夹中手动删除 packages.php,services.php,config.php ,然后尝试使用 composer dump-autoload 或通过删除 vendor 文件夹,通过 composer install 重新安装软件包.

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.

这篇关于Laravel 7-PHP Artisan Supplier:发布未正确列出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆