如何在Symfony中进行composer更新后修复类未找到的问题?

huangapple go评论65阅读模式
英文:

How can I fix a class not found after composer update in Symfony?

问题

自从我运行了composer update之后,我收到了以下错误信息:

找不到类 "Oneup\UploaderBundle\Uploader\Naming\UniqidNamer",
在加载 "App\Controller\myApp\OriginalNameNamer" 时发生了错误。

我无法弄清楚如何修复它。
我尝试了再次运行composer install,以及运行composer dumpautoload,但都没有帮助。

在我运行composer update之前,一切都很正常。

英文:

I made a composer update and since then I get an error message:

> Class "Oneup\UploaderBundle\Uploader\Naming\UniqidNamer" not found
> while loading "App\Controller\myApp\OriginalNameNamer".

And I just cannot figure out to fix it.
I made again composer install, and also composer dumpautoload but nothing helps

Everything was fine until I made composer update..

答案1

得分: 3

根据您的composer.json文件,该类完全缺失在您的项目中。可能以前它是某个其他包的依赖项,但现在不是了。
然而,您在代码中使用依赖项并不会让composer自动安装它。
只需运行

composer require oneup/uploader-bundle

它就会重新出现在您的项目中。

英文:

According to your composer.json the class is missing from your project completely. It could be that it was dependency of some other package before, but now isn't.
However, the fact you're using dependency in your code doesn't make composer install it.
Simply run

composer require oneup/uploader-bundle

and it will be back in your project

huangapple
  • 本文由 发表于 2020年1月3日 18:04:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/59576561.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定