【问题标题】:NPM failing on github branch dependencyNPM 在 github 分支依赖上失败
【发布时间】:2016-12-29 20:26:26
【问题描述】:

我的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 时也会发生同样的事情,这并不奇怪,因为它也使用了branch or tag

我认为它可能是企业代理,而 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,但没有成功。我尝试在 NPM 配置中添加代理,但没有成功。我有点迷茫,那么这个问题的下一个调试步骤是什么?

【问题讨论】:

标签: node.js github npm gulp npm-install


【解决方案1】:
github:gulpjs/gulp#4.0

表示要在仓库https://github.com/gulpjs/gulp/tags的4.0标签

没有标签4.0

也许有一个,但它已被删除,我不知道,但截至今天,这不起作用。

Gulp 在 npm https://www.npmjs.com/package/gulp 所以没必要这么写。

你应该有:

"gulp":"3.9.1"

[编辑]

是的,我的错,有一个 BRANCH 4.0

所以不妨试试这个:

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

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

不管怎样,你真的需要一个未发布的 gulp 分支吗?

【讨论】:

  • 这两个建议都不起作用。我以前试过,又试了一次。是的,不幸的是我需要 gulp 4 来获取新的 API,我真的不能等到他们最终发布它。
  • github:gulpjs/gulp 有效吗?我正在尝试查看问题是否只是分支还是更具全球性。
  • 这不起作用,我认为它试图通过另一个可能被阻止的协议来获取它,但它根本不透明。它以前有效,但可能发生了一些变化。
  • 你可以尝试克隆这个存储库吗?
  • 那是个谜……我想不通。一个丑陋的临时解决方案是将 gulp 放在本地直到 4.0 版本,但这并不能解决问题。祝你好运 ! stackoverflow.com/questions/14381898/…
猜你喜欢
  • 1970-01-01
  • 2013-04-28
  • 2014-08-08
  • 2022-01-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-06-12
相关资源
最近更新 更多