2013-01-18 35 views
3

我試圖更新我的Symfony 2項目從2.1.4使用作曲家2.1.7和正常運行php composer.phar update,更新一些依賴項後,我收到以下錯誤:通過作曲者更新不是一個混帳存儲庫錯誤

[RuntimeException] 
Failed to clone http://github.com/fabpot/Twig-extensions via git, https 
and http protocols, aborting. 

- git://github.com/fabpot/Twig-extensions 
    fatal: Not a git repository (or any of the parent directories): .git 

- https://github.com/fabpot/Twig-extensions 
    fatal: Not a git repository (or any of the parent directories): .git 

- http://github.com/fabpot/Twig-extensions 
    fatal: Not a git repository (or any of the parent directories): .git 

我檢查了網址並確認它存在,我也能夠git clone它沒有任何問題從相同的CLI。

奇怪的是,如果我單獨運行php composer.phar update twig/extensions它似乎更新沒有問題。

回答

16

這通常發生在如果你有一箇舊的symfony副本,作爲git repos安裝的供應商附帶,但是git repos已被刪除。要修復它,你應該刪除vendor目錄,以便它們將從頭開始重新安裝,比如git克隆或zip壓縮文件,但是沒有任何先前的假設。

+0

這工作完美。謝謝。 –

0

注意,目前我遇到類似的問題,而使用composerHHVM和PHP 7

[RuntimeException] 
Failed to execute git checkout 'hash' -- && git reset --hard 'hash' -- 
fatal: Not a git repository (or any of the parent directories): .git 

出現錯誤取決於composer.json並不總是而是定期。我關掉hhvm讓它工作。