错误:您引用了一个不存在的脚本@php artisan包:发现 [英] Error: You made a reference to a non-existent script @php artisan package:discover
问题描述
在laravel项目中运行 composer dump-autoload 时出现错误
I am getting error at running composer dump-autoload at laravel project
composer dump-autoload
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
You made a reference to a non-existent script @php artisan package:discover
然后执行php artisan包:发现返回
Then executing php artisan package:discover returns
Discovered Package: barryvdh/laravel-ide-helper
Discovered Package: cartalyst/sentinel
Discovered Package: laravelcollective/html
Discovered Package: laracasts/generators
Package manifest generated successfully.
然后再次出现相同的错误
Then again getting the same error
composer dump-autoload
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
You made a reference to a non-existent script @php artisan package:discover
可能有什么问题吗? composer自我更新
或 composer全局更新
无效.
What may be wrong? composer self-update
or composer global update
not helping.
推荐答案
好的,我认为即使出现该警告, composer dump-autoload
也可以正常工作.(由于用户: Sohel0415 注释)作曲家无法运行composer.json文件中带有@符号的脚本.
Okay, I think that composer dump-autoload
is working even with that warning. (thanks to the user:Sohel0415 comments) composer was not able to run
script with @ symbol in composer.json file.
如果您想摆脱此警告,只需执行
If you want to get rid of this warning simply do
composer dump-autoload --no-scripts
或
您可以在您的 composer.json中使用@
临时文件,应该一切都很好."post-autoload-dump":[]
从您的"scripts":{}
删除脚本
you may delete the script with @ "post-autoload-dump": []
from you "scripts": {}
in the composer.json
file temporarily, and it should be all good.
这篇关于错误:您引用了一个不存在的脚本@php artisan包:发现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!