【问题标题】:TeamCity fails to run "npm install" on WindowsServerTeamCity 无法在 WindowsServer 上运行“npm install”
【发布时间】:2016-02-07 20:25:07
【问题描述】:

我在 TeamCity 中有一个构建步骤,它正在执行

npm install

这是一个 Node.js 项目。

它因错误而失败:

[10:49:37]npm 错误! git 克隆 --template=C:\npm-cache_git-remotes_templates --mirror git://github.com/ifandelse/riveter.git C:\npm-cache_git-remotes\git-github-com-ifandelse-riveter-git-0cffebb92117c88543cb4359fb9fd69c2d65dd22-e68db054c0bd30b07ce1f9879b4f866f: 克隆到裸存储库 'C:\npm-cache_git-remotes\git-github-com-ifandelse-riveter-git-0cffebb92117c88543cb4359fb9fd69c2d65dd22-e68db054c0bd30b07ce1f9879b4f866f'... [10:49:37]npm 错误! git 克隆 --template=C:\npm-cache_git-remotes_templates --mirror git://github.com/ifandelse/riveter.git C:\npm-cache_git-remotes\git-github-com-ifandelse-riveter-git-0cffebb92117c88543cb4359fb9fd69c2d65dd22-e68db054c0bd30b07ce1f9879b4f866f: 致命:无法连接到 github.com:[10:49:37]npm ERR! git 克隆 --template=C:\npm-cache_git-remotes_templates --mirror git://github.com/ifandelse/riveter.git C:\npm-cache_git-remotes\git-github-com-ifandelse-riveter-git-0cffebb92117c88543cb4359fb9fd69c2d65dd22-e68db054c0bd30b07ce1f9879b4f866f: github.com[0: 192.30.252.129]: errno=No error [10:50:09]npm ERR! Windows_NT 6.1.7601 [10:50:09]npm 错误! argv "C:\程序 文件\nodejs\\node.exe" "C:\Program 文件\nodejs\node_modules\npm\bin\npm-cli.js" "安装" “--msvs_version=2012”[10:50:09]npm 错误!节点 v0.10.33 [10:50:09]npm 呃! npm v3.3.10 [10:50:09]npm 错误!代码 128 [10:50:09] [10:50:09]npm 呃!命令失败:克隆到裸存储库 'C:\npm-cache_git-remotes\git-github-com-ifandelse-riveter-git-0cffebb92117c88543cb4359fb9fd69c2d65dd22-e68db054c0bd30b07ce1f9879b4f866f'... [10:50:09]npm 错误!致命:无法连接到 github.com: [10:50:09]npm 错误! github.com[0: 192.30.252.129]: errno=没有错误 [10:50:09]npm 错误! [10:50:09]npm 错误! [10:50:09]npm 错误! [10:50:09]npm 错误!如果您需要帮助,可以在以下位置报告此错误: [10:50:09]npm 错误! https://github.com/npm/npm/issues;

我可以从命令行很好地运行 npm install。这需要“以管理员身份运行”的思想。

我已尝试将管理员角色添加到 TeamCityAgent 用户。

我很确定权限有问题。

【问题讨论】:

    标签: node.js npm continuous-integration teamcity


    【解决方案1】:

    可能是因为您无法通过 ssh 或 git 协议连接到 github(可能是因为防火墙或其他原因)。 尝试通过 https 强制 git 克隆:

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

    【讨论】:

      猜你喜欢
      • 2022-07-22
      • 1970-01-01
      • 1970-01-01
      • 2018-04-12
      • 2015-08-25
      • 2022-01-18
      • 1970-01-01
      • 2017-09-14
      • 2017-02-14
      相关资源
      最近更新 更多