Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Node 24 compatibility

未关闭
#992 23 条评论 62 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清

调研方向

使用提供的 jsonwebtoken.sign 示例,在 Node 24 上复现 jsonwebtoken 9.0.2 的失败,然后检查嵌套的依赖链 jws > jwa > buffer-equal-constant-time 以及失败的 index.js 行。当在保留 Node 22 上正常行为的同时,签名能够在 Node 24 上成功时,即表示完成。

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

描述

Description

jsonwebtoken doesn't work with Node 24. The buffer-equal-constant-time library throws an error:

Cannot read properties of undefined (reading 'prototype')

at

var origSlowBufEqual = SlowBuffer.prototype.equal;

buffer-equal-constant-time is a nested dep: jsonwebtoken > jws > jwa > buffer-equal-constant-time

Reproduction

Initialize a new Node project and install jsonwebtoken.

Run the following JS using Node 24.0.0

import jsonwebtoken from "jsonwebtoken";

jsonwebtoken.sign({ text: "test" }, "ABC");

Result:

var origSlowBufEqual = SlowBuffer.prototype.equal;
                                  ^

TypeError: Cannot read properties of undefined (reading 'prototype')
    at Object.<anonymous> (/Users/user/testnode24/node_modules/buffer-equal-constant-time/index.js:37:35)
    at Module._compile (node:internal/modules/cjs/loader:1734:14)
    at Object..js (node:internal/modules/cjs/loader:1899:10)
    at Module.load (node:internal/modules/cjs/loader:1469:32)
    at Module._load (node:internal/modules/cjs/loader:1286:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
    at Module.require (node:internal/modules/cjs/loader:1491:12)
    at require (node:internal/modules/helpers:135:16)
    at Object.<anonymous> (/Users/user/testnode24/node_modules/jwa/index.js:1:19)

Node.js v24.0.0
Environment
  • jsonwebtoken 9.0.2
  • Node 24.0.0
  • MacOS Sequoia

Running in Node 22 works without any issues.

主要语言
JavaScript
星标
18.2k
派生
1.3k
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

auth0/node-jsonwebtoken 的其他 Issue

查看 auth0/node-jsonwebtoken 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

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