【问题标题】:NPM update error - Fails to execute GITNPM 更新错误 - 无法执行 GIT
【发布时间】:2017-01-16 02:52:09
【问题描述】:

当我尝试创建项目时,出现以下错误。 它似乎与网络有关,因为它只出现在公司网络中。 知道如何解决这个问题吗?

D:\Projects\aurelia>au new test3

。 . .

安装项目依赖项。 npm 错误! git克隆

--template=C:\Users\user\AppData\Roaming\npm-cache_git-r emotes_templates --mirror git://github.com/gulpjs/gulp.git

C:\Users\AppData\Roaming\npm-cache_git-remotes\git-github-com-gulpjs-gulp-git-4-0ecf98f08

:npm 错误! git克隆

--template=C:\Users\user\AppData\Roaming\npm-cache_git-remotes_templates --mirror https://github.com/gulpjs/gulp.git

C:\Users\user\AppData\Roaming\npm-cache_git-remotes\git-https-github-com-gulpjs-gulp-git-40-4b46db44:npm 错误! git克隆

--template=C:\Users\user\AppData\Roaming\npm-cache_git-remotes_templates --mirror git@github.com:gulpjs/gulp.git

C:\Users\user\AppData\Roaming\npm-cache_git-remotes\git-github-com-gulpjs-gulp-git-4-0-7c06e801:

更新

这是我运行 npm install 时得到的结果

如果我复制粘贴失败的 git 命令,我会得到:

错误:SSL 证书问题,验证 CA 证书是否正常。 详细信息:错误:14090086:SSL 例程:SSL3_GET_SERVER_CERTIFICATE:证书验证失败,而 访问https://github.com/gulpjs/gulp.git/info/refs 致命:HTTP 请求失败

更新

我将丢失的证书添加到 git,现在我可以成功地自行运行 git 命令。如果我运行npm install,我仍然会收到错误消息。 我也听从了@Andrew 的建议,修改了 git 配置文件。

【问题讨论】:

  • 添加了一个答案,让我知道这是否真的适合你。如果没有,请在 Gitter (astoker) 上联系我,我可以尝试让您启动并运行。

标签: node.js git github npm aurelia


【解决方案1】:

尝试将您的 git 配置为使用 https 而不是 git。这似乎在工作网络中更频繁地起作用。
在控制台中输入以下命令:

git config --global url."https://".insteadOf git://

然后您可以尝试再次创建项目,或者如果它已经创建并且在依赖项检索步骤中失败,则只需运行npm install

另外,如果that doesn't work,您可能需要进一步指定 npm 何时将 git 与 ssh 一起使用。在这种情况下,也请运行以下命令: git config --global url."https://github.com/".insteadOf git@github.com:

【讨论】:

  • 感谢您的回答,我试过了,但我仍然得到同样的错误。在项目中运行 npm 会产生很多错误。
  • 具体同样的错误?您能否与您的 IT 人员交谈,看看他们是否阻止了任何特定的 Git 端口?另外,您是否可以为任何单独的包(比如 jQuery)运行 npm install ?
  • 我发布了一个打印屏幕,其中包含我在运行 npm install 和运行 git 时遇到的错误。我主要关心的是向 IT 人员提出什么要求。
  • 另外我应该提一下,当我发布这个问题时,git 命令运行良好,只有从 npm 执行时才会出现一个问题,这让我认为同时发生了一些变化。
  • 当您尝试安装单个软件包而不是整个 shebang 时会发生什么?
猜你喜欢
  • 2016-06-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-10-19
  • 2015-07-09
  • 1970-01-01
  • 2018-11-30
相关资源
最近更新 更多