npm安装在访问GIT网址时发生错误 [英] npm install giving error while accessing GIT url
问题描述
我的package.json具有以下依赖项:
{
pre>
name:AppName,
version:0.0.0,
description:应用说明,
author:@author,
dependencies:{},
devDependencies:{
css-flip:git://github.com/geedmo/css-flip,
gulp:^ 3.8.10,
gulp-angular-htmlify:^ 0.4.0,
gulp-changed:^ 1.1.0,
gulp-compass:^ 2.0。 4,
gulp-concat:^ 2.4.1,
gulp-css-flip:^ 0.4.0,
gulp-expect-file :0.0.7,
gulp-filter:^ 1.0.2,
gulp-html-prettify:0.0.1,
gulp-if :^ 1.2.5,
gulp-ignore:^ 1.2.1,
gulp-jade:^ 0.8.0,
gulp- jsvalidate:^ 2.0.0,
gulp-less:^ 1.3.9,
gulp-livereload:^ 2.1.1,
gulp -load-plugins:^ 0.10.0,
gulp-minify-css:^ 0.3.11,
gulp-ng-annotate:^ 0.4.3 ,
gulp-rename:^ 1.2.0,
gulp-sass:^ 1.3.2,
gulp-sourcemaps:^ 1.3.0,
gulp-sync:^ 0.1.4,
gulp-uglify:^ 1.1.0,
gulp-util:^ 3.0.1,
标记:^ 0.3.2,
through2:^ 0.6.3,
yargs:^ 3.7.2
},
scripts:{
prestart:bower安装,
start:npm install,
poststart:gulp
}
}
执行
npm install
命令时,出现以下错误:
npm WARN addRemoteGit错误:命令失败:git -c core.longpaths = true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit at ChildProcess.exithandler(child_process.js:751:12)
npm WARN addRemoteGit at ChildProcess.emit(events.js:110:17)
npm WARN addRemoteGit at maybeClose(child_process .js:1015:16)
npm WARN addNototeGit at Socket。< anonymous> (child_process.js:1183:11)
npm WARN addRemoteGit在Socket.emit(events.js:107:17)
npm WARN addRemoteGit在Pipe.close(net.js:485:12)
npm WARN addRemoteGit git://github.com/geedmo/css-flip.git重置远程C:\ Users \drj8cob\AppData\Roaming\\\
pm-cache\_git-remotes\git因为错误:{
[错误:命令失败:git -c core.longpaths = true配置--get remote.origin.url
- github-com-geedmo-css-flip-git-3c35004c npm WARN addRemoteGit]
npm WARN addRemoteGit killed:false,
npm WARN addRemoteGit代码:1,
npm WARN addRemoteGit signal:null,
npm WARN addRemoteGit cmd:'git -c core.longpaths = true config --get remote.origin.url'}
npm ERR! git clone --template = C:\ Users \drj8cob\AppData\Roaming\\\
pm-cache\_git-remotes\_templates --mirror git://github.com/geedmo/css-flip。 git C:\ Users \drj8cob\AppData\Roaming\\\
pm-cache\_git-remot
es\git-github-com-geedmo-css-flip-git-3c35004c:克隆到裸仓库'C:\ Users \drj8cob\AppData\Roaming\\\
pm-cache\_git-remotes\git-github-com-geedmo -css-flip-git-3c35004c'...
npm ERR! git clone --template = C:\ Users \drj8cob\AppData\Roaming\\\
pm-cache\_git-remotes\_templates --mirror git://github.com/geedmo/css-flip。 git C:\ Users \drj8cob\AppData\Roaming\\\
pm-cache\_git-remot
es\git-github-com-geedmo-css-flip-git-3c35004c:致命的:无法查找github.com(端口9418)(没有这样的主机是已知的。)
npm ERR! Windows_NT 6.1.7601
npm ERR! argvC:\\Program Files\\\\
odejs\\\\\\
ode.exeC:\\ Program Files \\\
odejs\\\\
ode_modules\\ npm \\\\\\\\\ npm-cli.jsinstall
npm ERR!节点v0.12.7
npm ERR! npm v2.11.3
npm ERR!代码128
npm ERR!命令失败:git -c core.longpaths = true clone --template = C:\Users\drj8cob\AppData\Roaming\\\
pm-cache\_git-remotes\_templates --mirror git:// github.com/geedmo/css-flip.git C:\ Users \drj8c
ob\AppData\Roaming\\\
pm-cache\_git-remotes\git-github-com-geedmo- css-flip-git-3c35004c
npm ERR!克隆到裸仓库'C:\ Users \drj8cob\AppData\Roaming\\\
pm-cache\_git-remotes\git-github-com-geedmo-css-flip-git-3c35004c'...
npm ERR!致命的:无法查找github.com(端口9418)(没有这样的主机是已知的。)
npm ERR!
npm ERR!
npm ERR!如果您需要帮助,您可以在以下位置报告此错误:
npm ERR! < HTTPS://github.com/npm/npm/issues>
我是节点模块和git的新手。我需要在节点模块中进行与GIT相关的任何配置吗?
** :**我在公司代理之后。应该给任何配置相关的?我在
users /< username> /。npmrc
文件中的.npmrc文件中添加了代理详细信息。我的路径变量也有Git / bin位置。
解决方案此问题在其他螺纹 即可。这个问题发生在我支持公司代理之后。和 @ bnguyen82 的回答帮助了我最后。
我刚刚使用了下面的命令,问题得到了解决。
git config --global url。https://.insteadOf git://
my package.json has the following dependency,
{ "name": "AppName", "version": "0.0.0", "description": "App Description", "author": "@author", "dependencies": {}, "devDependencies": { "css-flip": "git://github.com/geedmo/css-flip", "gulp": "^3.8.10", "gulp-angular-htmlify": "^0.4.0", "gulp-changed": "^1.1.0", "gulp-compass": "^2.0.4", "gulp-concat": "^2.4.1", "gulp-css-flip": "^0.4.0", "gulp-expect-file": "0.0.7", "gulp-filter": "^1.0.2", "gulp-html-prettify": "0.0.1", "gulp-if": "^1.2.5", "gulp-ignore": "^1.2.1", "gulp-jade": "^0.8.0", "gulp-jsvalidate": "^2.0.0", "gulp-less": "^1.3.9", "gulp-livereload": "^2.1.1", "gulp-load-plugins": "^0.10.0", "gulp-minify-css": "^0.3.11", "gulp-ng-annotate": "^0.4.3", "gulp-rename": "^1.2.0", "gulp-sass": "^1.3.2", "gulp-sourcemaps": "^1.3.0", "gulp-sync": "^0.1.4", "gulp-uglify": "^1.1.0", "gulp-util": "^3.0.1", "marked": "^0.3.2", "through2": "^0.6.3", "yargs": "^3.7.2" }, "scripts": { "prestart": "bower install", "start": "npm install", "poststart": "gulp" } }
when I execute
npm install
command, I am getting the following error,npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url npm WARN addRemoteGit npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:751:12) npm WARN addRemoteGit at ChildProcess.emit (events.js:110:17) npm WARN addRemoteGit at maybeClose (child_process.js:1015:16) npm WARN addRemoteGit at Socket.<anonymous> (child_process.js:1183:11) npm WARN addRemoteGit at Socket.emit (events.js:107:17) npm WARN addRemoteGit at Pipe.close (net.js:485:12) npm WARN addRemoteGit git://github.com/geedmo/css-flip.git resetting remote C:\Users\drj8cob\AppData\Roaming\npm-cache\_git-remotes\git-github-com-geedmo-css-flip-git-3c35004c because of error: { [Error: Command failed: git -c core.longpaths=true config --get remote.origin.url npm WARN addRemoteGit ] npm WARN addRemoteGit killed: false, npm WARN addRemoteGit code: 1, npm WARN addRemoteGit signal: null, npm WARN addRemoteGit cmd: 'git -c core.longpaths=true config --get remote.origin.url' } npm ERR! git clone --template=C:\Users\drj8cob\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/geedmo/css-flip.git C:\Users\drj8cob\AppData\Roaming\npm-cache\_git-remot es\git-github-com-geedmo-css-flip-git-3c35004c: Cloning into bare repository 'C:\Users\drj8cob\AppData\Roaming\npm-cache\_git-remotes\git-github-com-geedmo-css-flip-git-3c35004c'... npm ERR! git clone --template=C:\Users\drj8cob\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/geedmo/css-flip.git C:\Users\drj8cob\AppData\Roaming\npm-cache\_git-remot es\git-github-com-geedmo-css-flip-git-3c35004c: fatal: Unable to look up github.com (port 9418) (No such host is known. ) npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" npm ERR! node v0.12.7 npm ERR! npm v2.11.3 npm ERR! code 128 npm ERR! Command failed: git -c core.longpaths=true clone --template=C:\Users\drj8cob\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/geedmo/css-flip.git C:\Users\drj8c ob\AppData\Roaming\npm-cache\_git-remotes\git-github-com-geedmo-css-flip-git-3c35004c npm ERR! Cloning into bare repository 'C:\Users\drj8cob\AppData\Roaming\npm-cache\_git-remotes\git-github-com-geedmo-css-flip-git-3c35004c'... npm ERR! fatal: Unable to look up github.com (port 9418) (No such host is known. ) npm ERR! npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! <https://github.com/npm/npm/issues>
I am new to node modules and git. Should i have to do any configuration related to GIT in node modules?
**[Edit] : ** I am behind a corporate proxy. Should have to give any configuration related to that? I added proxy details in .npmrc file in
users/<username>/.npmrc
file. My path variable has the Git/bin location as well.解决方案This question has an answer in an other thread. The issue occurred since I was behind corporate proxy. And @bnguyen82's answer helped me finally.
I just used the following command and the issue got resolved.
git config --global url."https://".insteadOf git://
这篇关于npm安装在访问GIT网址时发生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!