Composer安装无法克隆

时间:2018-07-06 16:03:21

标签: php git composer-php drupal-8

我正在尝试在新的Drupal项目上执行composer install,但失败并出现以下错误:

  [RuntimeException]
  Failed to clone https://github.com/jeromegn/Backbone.localStorage.git via https, ssh, git protocols, aborti
  ng.

  - https://github.com/jeromegn/Backbone.localStorage.git
    Cloning into 'web/libraries/backbone.localstorage'...
    done.
    sh: line 0: cd: web/libraries/backbone.localstorage: No such file or directory

  - git@github.com:jeromegn/Backbone.localStorage.git
    Cloning into 'web/libraries/backbone.localstorage'...
    done.
    sh: line 0: cd: web/libraries/backbone.localstorage: No such file or directory

  - git://github.com/jeromegn/Backbone.localStorage.git
    Cloning into 'web/libraries/backbone.localstorage'...
    done.
    sh: line 0: cd: web/libraries/backbone.localstorage: No such file or directory

系统详细信息:

macOS 10.12.6
git version 2.18.0
Composer version 1.6.5 2018-05-04 11:44:59
PHP 7.0.30 (cli) (built: Jun 22 2018 00:52:06) ( NTS )
  Copyright (c) 1997-2017 The PHP Group
  Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
  with Zend OPcache v7.0.30, Copyright (c) 1999-2017, by Zend Technologies

令人困惑的是,我的同事没有收到此错误,并且他们有相似的计算机,运行相同的操作系统以及composer / php / git版本。

我尝试了以下操作均无济于事:

  • 使用brew reinstall git重新安装git
  • 使用rm -rf vendor删除供应商目录
  • 使用composer clear-cache清除作曲家缓存
  • composer.json中删除localStorage程序包(即使清除了缓存,也会出现完全相同的错误)
  • 正在运行带有--prefer-dist标志的作曲家安装
  • 正在运行带有--prefer-source标志的作曲家安装

我也尝试运行composer update,但出现此错误:

  [RuntimeException]
  Failed to execute git clone --no-checkout '/Users/delucac/.composer/cache/vcs/https---git.drupal.org-project-ma
  illog/' 'web/modules/contrib/maillog' --dissociate --reference '/Users/delucac/.composer/cache/vcs/https---git.
  drupal.org-project-maillog/' && cd 'web/modules/contrib/maillog' && git remote set-url origin 'https://git.drup
  al.org/project/maillog' && git remote add composer 'https://git.drupal.org/project/maillog'

  Cloning into 'web/modules/contrib/maillog'...
  done.
  sh: line 0: cd: web/modules/contrib/maillog: No such file or directory

我在Google周围搜索,发现了几个具有相同/相似问题,但没有解决方案的线程。

任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

我发现了问题。

我不确定为什么,该错误并不能真正表明这一点,但是从我的.bashrc中删除此行可以解决此问题:

export CDPATH='~:~/Sites'

这为Home或Sites中任何顶级目录的cd完成提供了“自动书签”,并且显然修改了某些路径,但是我仍然困惑为什么这会引起问题。

如果有人对此有进一步的了解,我将不胜感激。