问题描述
我很高兴在开发环境中工作,突然开始出现以下错误:
I was happily working away in my development environment and suddenly I started getting the following error:
在作曲家依赖方面我没有做任何改动(尽管我认为我确实在那个时间范围内的某个地方做了了 composer update
,但没有
I haven't made any changes to speak of in composer dependencies (although I think I did do a composer update
somewhere in that timeframe but no changes to the dependencies/packages used so nothing big should have changed.
值得注意的是,当我在笔记本电脑上查看存储库时,没有得到此错误,但是如果我 git clone
一个干净的仓库,然后在我的主要开发计算机上安装 composer安装
,我确实得到了这个错误,所以我假设是一定有一些特定于机器的起源,但是我对这可能是什么没有足够的想法。
Notably, when I checkout the repo on my laptop I do NOT get this error but if I git clone
a clean repo and then composer install
on my main development machine I DO get this error. So I'm assuming it must have some machine-specific origin but I'm running out of ideas on what that might be.
任何他
运行PHPUnit 4.0.17,并在尝试运行单元测试的最初阶段触发该错误(与WHICH单元测试无关)。这是堆栈跟踪:
Also of note is that I'm running PHPUnit 4.0.17 and the error is triggered at the very first stages of trying to run a unit test (it doesn't matter WHICH unit test). Here's the stack trace:
0.0009 636648 1. {main}() [APP_BASE]/vendor/phpunit/phpunit/phpunit:0
0.0465 1423664 2. PHPUnit_TextUI_Command::main() [APP_BASE]/vendor/phpunit/phpunit/phpunit:54
0.0465 1424280 3. PHPUnit_TextUI_Command->run() [APP_BASE]/vendor/phpunit/phpunit/src/TextUI/Command.php:132
0.0465 1424280 4. PHPUnit_TextUI_Command->handleArguments() [APP_BASE]/vendor/phpunit/phpunit/src/TextUI/Command.php:141
0.0674 2123344 5. PHPUnit_TextUI_Command->handleBootstrap() [APP_BASE]/vendor/phpunit/phpunit/src/TextUI/Command.php:638
0.0681 2139872 6. PHPUnit_Util_Fileloader::checkAndLoad() [APP_BASE]/vendor/phpunit/phpunit/src/TextUI/Command.php:808
0.0681 2140008 7. PHPUnit_Util_Fileloader::load() [APP_BASE]/vendor/phpunit/phpunit/src/Util/Fileloader.php:77
0.0774 2144176 8. include_once('[APP_BASE]/tests/test-loader.php') [APP_BASE]/vendor/phpunit/phpunit/src/Util/Fileloader.php:93
0.0775 2146736 9. include('[APP_BASE]/vendor/autoload.php') [APP_BASE]/tests/test-loader.php:2
推荐答案
删除编写器。锁定
和供应商/
,然后再次运行 composer更新
。
Delete composer.lock
and vendor/
and run composer update
again.
这篇关于PHP / Composer无法重新声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!