【问题标题】:Strange Bower / Git error (error code #128, could not chdir to 'Y:/')奇怪的 Bower / Git 错误(错误代码 #128,无法 chdir 到 'Y:/')
【发布时间】:2014-05-08 12:51:07
【问题描述】:

我刚刚在全新安装的 OS X 10.9.2 上安装了 Node/NPM/Yeoman。 Xcode 工具全部安装完毕。我拉下一个当前项目的存储库并运行bower install 来安装依赖项。输出如下所示:

bower angular#1.2.6         not-cached git://github.com/angular/bower-angular.git#1.2.6
bower angular#1.2.6            resolve git://github.com/angular/bower-angular.git#1.2.6
bower json3#~3.2.6          not-cached git://github.com/bestiejs/json3.git#~3.2.6
bower json3#~3.2.6             resolve git://github.com/bestiejs/json3.git#~3.2.6
bower es5-shim#~2.1.0       not-cached git://github.com/es-shims/es5-shim.git#~2.1.0
bower es5-shim#~2.1.0          resolve git://github.com/es-shims/es5-shim.git#~2.1.0
bower jquery#~1.10.2        not-cached git://github.com/jquery/jquery.git#~1.10.2
bower jquery#~1.10.2           resolve git://github.com/jquery/jquery.git#~1.10.2
bower bootstrap#~3.0.3      not-cached git://github.com/twbs/bootstrap.git#~3.0.3
bower bootstrap#~3.0.3         resolve git://github.com/twbs/bootstrap.git#~3.0.3
bower angular-resource#1.2.6       not-cached git://github.com/angular/bower-angular-resource.git#1.2.6
bower angular-resource#1.2.6          resolve git://github.com/angular/bower-angular-resource.git#1.2.6
bower angular-route#1.2.6          not-cached git://github.com/angular/bower-angular-route.git#1.2.6
bower angular-route#1.2.6             resolve git://github.com/angular/bower-angular-route.git#1.2.6
bower angular-file-upload#0.4.1    not-cached git://github.com/nervgh/angular-file-upload.git#0.4.1
bower angular-file-upload#0.4.1       resolve git://github.com/nervgh/angular-file-upload.git#0.4.1
bower angular-mocks#1.2.6          not-cached git://github.com/angular/bower-angular-mocks.git#1.2.6
bower angular-mocks#1.2.6             resolve git://github.com/angular/bower-angular-mocks.git#1.2.6
bower angular-scenario#1.2.6       not-cached git://github.com/angular/bower-angular-scenario.git#1.2.6
bower angular-scenario#1.2.6          resolve git://github.com/angular/bower-angular-scenario.git#1.2.6
bower angular-mocks#1.2.6             ECMDERR Failed to execute "git ls-remote --tags --heads git://github.com/angular/bower-angular-mocks.git", exit code of #128

Additional error details:
fatal: Could not chdir to 'Y:/': No such file or directory

有趣的是,每次我运行 bower install 时,ECMDERR 发生的包都会发生变化,这似乎表明它不是导致错误的特定包。

我发现了几个不同的例子,人们在从防火墙后面克隆时遇到错误 #128。它有been suggested 可以通过运行git config --global url."https://".insteadOf git:// 来解决这个问题,以便告诉git 使用HTTPS 作为协议而不是git,但这并没有解决我的问题。更令人困惑的是fatal: Could not chdir to 'Y:/': No such file or directory。坦率地说,我不知道这是从哪里来的。它似乎只在我运行某些 git 命令时出现,例如 ls-remote

另外,我可以通过SSHHTTPS 成功手动克隆。此错误仅在 Bower 中发生。

有人对如何解决这个问题有任何建议吗?我已经搜索了很多,但找不到任何其他提及它的内容。任何帮助将不胜感激!

【问题讨论】:

  • 原来这与我的项目位于通过SMB 本地安装的网络驱动器上有关。当我在本地复制项目并运行命令时,它起作用了。我需要寻找一种更好的方法来使用 Git 访问 samba 共享。如果有人有任何想法,我绝对愿意接受。

标签: node.js git osx-mavericks bower


【解决方案1】:

这是因为在代理环境中 Http 和 Https 是首选,所以而不是

"devDependencies": {

    "file-loader": "^0.8.4",
    "gh-pages": "git://github.com/markdalgleish/gh-pages#cli-message",

  }

用 Https 代替

"devDependencies": {

        "file-loader": "^0.8.4",
        "gh-pages": "Https://github.com/markdalgleish/gh-pages#cli-message",

      }

或者你可以在你的全球回购中设置它

祝你好运!!

【讨论】:

    【解决方案2】:

    我添加了同样的问题

    [url "https:"]
        insteadOf = git:
    

    到 YOUR_REPO/.git/config 成功了,https 没有双斜杠

    【讨论】:

      【解决方案3】:

      我也有这个问题。我的解决方案是添加到存储库配置

      [url "https://"]
          insteadOf = git://
      

      文件位于 YOUR_REPO/.git/config

      不在全局配置中,例如:

      git config --global url."https://github.com/".insteadOf git@github.com:
      git config --global url."https://".insteadOf git://
      

      【讨论】:

        【解决方案4】:

        我在尝试 angular-seed 时遇到了同样的错误。

        但是我的解决方案不是将项目移动到本地磁盘(该项目已经是本地的)。作为运行时问题的解决方法

        npm install
        

        我先安装了 bower 命令,然后直接使用 bower install 来安装 bower 包。中间有一个缓存清理,这是很好的衡量标准。

        sudo npm install -g bower
        bower cache clean
        bower install
        

        希望这将有助于减轻其他人的挫败感。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2013-08-25
          • 2022-08-23
          • 2013-10-05
          • 1970-01-01
          相关资源
          最近更新 更多