gabrielcsapo / gabrielcsapo/node-git-server

TypeError: next is not a function

未关闭
#91 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
262
派生
81
PR 合并指标
30 天内没有已合并 PR

描述

When I run the authentication sample code from the [documentation](https://gabrielcsapo.github.io/node-git-server/code/index.html) and then try to clone an existing repository, I get the following error. I've changed nothing about the sample code other than the directory and the port number, so I'd assume this is an issue with the source code.

> server.js:13
> next();
> ^
>
> TypeError: next is not a function
> at Git.authenticate (server.js:13:9)
> at Git.res.statusCode (node_modules/node-git-server/lib/git.js:307:38)
> at next (node_modules/node-git-server/lib/git.js:425:32)
> at Git.handle (node_modules/node-git-server/lib/git.js:427:9)
> at Server. (node_modules/node-git-server/lib/git.js:450:16)
> at Server.emit (node:events:390:28)
> at parserOnIncoming (node:_http_server:951:12)
> at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
>
> Node.js v17.2.0

贡献指南

这个仓库没有索引到贡献指南

调研方向

从链接文档中的身份验证示例开始,将其 callback 的使用方式与 node_modules/node-git-server/lib/git.js 中报告的第 307、425-450 行进行比较。在 Node.js 17.2.0 上重现 clone 操作,并追踪 next 不是函数的原因;当现有 repository 能够在不出现此 TypeError 的情况下完成 clone 时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
git, node.js, typescript
领域
authentication, backend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。