NPM失败github分支依赖

我有我的package.json当前依赖项:

 "gulp": "github:gulpjs/gulp#4.0", 

这已经工作了一段时间,但突然间,我得到以下错误:

 λ npm i 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:206:12) npm WARN addRemoteGit at emitTwo (events.js:106:13) npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7) npm WARN addRemoteGit at maybeClose (internal/child_process.js:852:16) npm WARN addRemoteGit at Socket.<anonymous> (internal/child_process.js:323:11) npm WARN addRemoteGit at emitOne (events.js:96:13) npm WARN addRemoteGit at Socket.emit (events.js:188:7) npm WARN addRemoteGit at Pipe._handle.close [as _onclose] (net.js:492:12) npm WARN addRemoteGit gulpjs/gulp#4.0 resetting remote C:\Users\ekalkj\AppData\Roaming\npm-cache\_git-remotes\git-github-com-gulpjs-gulp-git-4-0-ecf98f08 because of error: { 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:206:12) npm WARN addRemoteGit at emitTwo (events.js:106:13) npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7) npm WARN addRemoteGit at maybeClose (internal/child_process.js:852:16) npm WARN addRemoteGit at Socket.<anonymous> (internal/child_process.js:323:11) npm WARN addRemoteGit at emitOne (events.js:96:13) npm WARN addRemoteGit at Socket.emit (events.js:188:7) npm WARN addRemoteGit at Pipe._handle.close [as _onclose] (net.js:492:12) 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\ekalkj\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/gulpjs/gulp.git C:\Users\ekalkj\AppData\Roaming\npm-cache\_git-remotes\git-github-com-gulpjs-gulp-git-4-0-ecf98f08: Cloning into bare repository 'C:\Users\ekalkj\AppData\Roaming\npm-cache\_git-remotes\git-github-com-gulpjs-gulp-git-4-0-ecf98f08'... npm WARN addRemoteGit gulpjs/gulp#4.0 pre-existing cached repo C:\Users\ekalkj\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-gulpjs-gulp-git-4-0-4b46db44 points to undefined and not https://github.com/gulpjs/gulp.git npm ERR! git submodule -q update --init --recursive: Unable to determine absolute path of git directory npm ERR! git submodule -q update --init --recursive: 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:206:12) npm WARN addRemoteGit at emitTwo (events.js:106:13) npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7) npm WARN addRemoteGit at maybeClose (internal/child_process.js:852:16) npm WARN addRemoteGit at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5) npm WARN addRemoteGit gulpjs/gulp#4.0 resetting remote C:\Users\ekalkj\AppData\Roaming\npm-cache\_git-remotes\git-github-com-gulpjs-gulp-git-4-0-7c06e801 because of error: { 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:206:12) npm WARN addRemoteGit at emitTwo (events.js:106:13) npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7) npm WARN addRemoteGit at maybeClose (internal/child_process.js:852:16) npm WARN addRemoteGit at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5) 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\ekalkj\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:gulpjs/gulp.git C:\Users\ekalkj\AppData\Roaming\npm-cache\_git-remotes\git-github-com-gulpjs-gulp-git-4-0-7c06e801: Cloning into bare repository 'C:\Users\ekalkj\AppData\Roaming\npm-cache\_git-remotes\git-github-com-gulpjs-gulp-git-4-0-7c06e801'... npm ERR! git clone --template=C:\Users\ekalkj\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:gulpjs/gulp.git C:\Users\ekalkj\AppData\Roaming\npm-cache\_git-remotes\git-github-com-gulpjs-gulp-git-4-0-7c06e801: ssh: connect to host github.com port 22: Connection timed out npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ekalkj\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "i" npm ERR! node v6.4.0 npm ERR! npm v3.10.7 npm ERR! code 128 npm ERR! Command failed: git -c core.longpaths=true clone --template=C:\Users\ekalkj\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:gulpjs/gulp.git C:\Users\ekalkj\AppData\Roaming\npm-cache\_git-remotes\git-github-com-gulpjs-gulp-git-4-0-7c06e801 npm ERR! Cloning into bare repository 'C:\Users\ekalkj\AppData\Roaming\npm-cache\_git-remotes\git-github-com-gulpjs-gulp-git-4-0-7c06e801'... npm ERR! ssh: connect to host github.com port 22: Connection timed out 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! C:\Projects\danskespil.website\npm-debug.log 

当我删除gulp 4依赖项时,它的工作方式应该是这样。

在做npm install glob-fs时候会发生同样的事情,这并不奇怪,因为它也使用分支或标签 。

我认为这可能是企业代理,而npm在打分支或标签时还会做其他事情。

我试过git config --global url."https://github.com/".insteadOf git@github.com:但没有运气,只是一个新的错误:

 npm ERR! git submodule -q update --init --recursive: Unable to determine absolute path of git directory npm ERR! git submodule -q update --init --recursive: npm ERR! git submodule -q update --init --recursive: Unable to determine absolute path of git directory npm ERR! git submodule -q update --init --recursive: npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ekalkj\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "glob-fs" npm ERR! node v6.4.0 npm ERR! npm v3.10.7 npm ERR! code 1 npm ERR! Command failed: git -c core.longpaths=true submodule -q update --init --recursive npm ERR! Unable to determine absolute path of git directory 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! C:\Projects\danskespil.website\npm-debug.log 

我试图更新git-for-windows,nodejs和npm没有运气。 我尝试添加代理到NPMconfiguration没有运气。 我有点失落,那么这个问题的下一个debugging步骤是什么?

 github:gulpjs/gulp#4.0 

意思是你想在仓库https://github.com/gulpjs/gulp/tags中使用4.0标&#x7B7E;

没有标签4.0

也许有一个,它被删除,我不知道,但截至今天,这是行不通的。

gulp是在npm https://www.npmjs.com/package/gulp所以没有必要这样写&#x3002;

你应该有 :

 "gulp":"3.9.1" 

[编辑]

Yups,我的坏,有一个分支4.0

所以也许试试这个:

 "gulp":"git+ssh://git@github.com:gulpjs/gulp#4.0" 

要么

 "gulp":"https://github.com/gulpjs/gulp.git#4.0" 

无论如何,你是否真的需要一个未发行的分支?