【问题标题】:Yeoman office generator not able to clone libxml2 repo on Windows 7Yeoman office generator 无法在 Windows 7 上克隆 libxml2 存储库
【发布时间】:2017-01-28 10:04:20
【问题描述】:

我正在尝试使用 yeoman 生成器创建 Office 插件。我正在按照说明进行操作 https://dev.office.com/docs/add-ins/get-started/create-an-office-add-in-using-any-editor.

在执行yo office 时,我收到以下错误。

Command failed: git -c core.longpaths=true submodule -q update --init --recursive
fatal: https://git.gnome.org/libxml2/info/refs?service=git-upload-pack not found: did you run git update-server-info on the server?
Clone of 'git://git.gnome.org/libxml2' into submodule path 'libxml2' failed

这是完整的日志:

d:\Projects\295_Office365ExcelAddin\myHelloWorldaddin>yo office

     _-----_     ?──────────────────────────?
    |       |    │   Welcome to the Office  │
    |--(o)--|    │   Project generator, by  │
   `---------'   │ @OfficeDev! Let's create │
    ( _'U`_ )    │    a project together!   │
    /___A___\   /?──────────────────────────?
     |  ~  |
   __'.___.'__
 '   `  |° ' Y `

? Project name (display name): myHelloWorldaddin
? Root folder of project? Default to current directory
 (d:\Projects\295_Office365ExcelAddin\myHelloWorldaddin), or specify relative path
 from current (src / public):  .
? Office project type: Task Pane Add-in
? Supported Office applications: Excel
? Technology to use: HTML, CSS & JavaScript
   create bower.json
   create package.json
   create tsd.json
   create .bowerrc
   create gulpfile.js
   create content\Office.css
   create images\close.png
   create images\logo-filled.png
   create scripts\MicrosoftAjax.js
   create jsconfig.json
   create tsconfig.json
   create manifest-myhelloworldaddin.xml
   create manifest.xsd
   create app\app.css
   create app\app.js
   create app\home\home.html
   create app\home\home.css
   create app\home\home.js
npm ERR! git submodule -q update --init --recursive: fatal: https://git.gnome.org/libxml2/info/refs?service=git-upload-pack not found: did you run git update-server-info
on the server?
npm ERR! git submodule -q update --init --recursive: Clone of 'git://git.gnome.org/libxml2' into submodule path 'libxml2' failed
npm ERR! git submodule -q update --init --recursive:
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\\ProgramFiles\\nodejs\\node.exe" "D:\\ProgramFiles\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v7.4.0
npm ERR! npm  v4.0.5
npm ERR! code 1

npm ERR! Command failed: git -c core.longpaths=true submodule -q update --init --recursive
npm ERR! fatal: https://git.gnome.org/libxml2/info/refs?service=git-upload-pack not found: did you run git update-server-info on the server?
npm ERR! Clone of 'git://git.gnome.org/libxml2' into submodule path 'libxml2' failed
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     d:\Projects\295_Office365ExcelAddin\myHelloWorldaddin\npm-debug.log

任何线索为什么会发生这种情况?

编辑: Git 协议在我的工作场所被阻止,因此我在 .gitconfig 中添加了以下内容。

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

【问题讨论】:

    标签: git office365 yeoman office-js yo


    【解决方案1】:

    我发现 git://git.gnome.org/libxml2 的 https url 不是 https://git.gnome.org/libxml2。是https://git.gnome.org/browse/libxml2

    最后我将以下内容添加到我的.gitconfig 文件中。

    [url "https://git.gnome.org/browse/"]
        insteadOf = "git://git.gnome.org/"
    [url "https://"]
        insteadOf = "git://"
    

    通过这些设置,它工作正常。

    【讨论】:

    • 奇怪.. git.gnome.org/libxml2 当我尝试在浏览器中点击它时,实际上解析为git.gnome.org//browse/libxml2。你知道你运行的是什么 git 版本吗?
    • 我只看到 'git submodule sync && git submodule update --init --recursive' 当存在防火墙/代理问题时,此命令会失败。 'cd /tmp/ && git clone git://git.gnome.org/libxml2' 还有什么作用吗?
    • @BethPan 我正在使用“git 版本 1.8.1.msysgit.1”
    • @BethPan d:\tmp2&gt;git clone git://git.gnome.org/libxml2 Cloning into 'libxml2'... fatal: unable to connect to git.gnome.org: git.gnome.org[0: 209.132.180.184]: errno=No error 这是没有 gitconfig 中的insteadOf 设置。
    • @BethPan 请注意,git 协议在我的工作场所被阻止。 curl http://github.com:9418 打印 curl: (7) couldn't connect to host。您是否可以通过暂时阻止 9418 端口来重现此问题?
    猜你喜欢
    • 1970-01-01
    • 2017-09-09
    • 2013-04-19
    • 1970-01-01
    • 2016-08-24
    • 2014-10-26
    • 1970-01-01
    • 2017-10-17
    相关资源
    最近更新 更多