NPM更新错误 - 无法执行GIT [英] NPM update error - Fails to execute GIT

查看:508
本文介绍了NPM更新错误 - 无法执行GIT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试创建一个项目时,出现下面的错误。
似乎与网络有关,因为它只发生在公司网络中。
任何想法如何解决这个问题?


D:\Projects\aurelia> au new test3



。 。 。



安装项目依赖关系。 npm ERR! git clone



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



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



:npm ERR! git clone



- template = C:\Users\user\AppData\Roaming\\\
pm-cache_git-remotes_templates --mirror



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


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


UPDATE



我将缺少的证书添加到git中,现在我可以运行git命令本身成功。如果我运行 npm install ,我仍然遇到错误。
我也遵循@Andrew的建议并修改了git配置文件。 解决方案

尝试配置你的git以使用https而不是git。这似乎在工作网络中更频繁地工作。

在控制台中键入以下命令:

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

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



另外,如果不起作用,您可能需要进一步指定npm何时与ssh一起使用git。在这种情况下,运行以下命令:

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


When I try to create a project I get the error below. It seems to be network related because it occurs only in company network. Any idea how to troubleshoot that?

D:\Projects\aurelia>au new test3

. . .

Installing project dependencies. npm ERR! git clone

--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 ERR! git clone

--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 ERR! git clone

--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:

UPDATE

This what I get when I run npm install

If I copy paste the git command that fails I get this:

error: SSL certificate problem, verify that the CA cert is OK. Details:error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://github.com/gulpjs/gulp.git/info/refs fatal: HTTP request failed

UPDATE

I added the missing certificate to git, and now I can run the git command by itself successfully. If I run npm install I still get an error. I also followed the advice of @Andrew and modified the git config file.

解决方案

Try configuring your git to use https instead of git. That seems to work more frequently inside work networks.
Type this command into your console:

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

Then you can try to create the project again, or just run npm install if it's already been created and it just failed on the dependency retrieval step.

Additionally, if that doesn't work, you might need to further specify when npm is using git with ssh. In this case, run this command as well: git config --global url."https://github.com/".insteadOf git@github.com:

这篇关于NPM更新错误 - 无法执行GIT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆