gpt4 book ai didi

discord.js - 意外的 token '?' discord.js

转载 作者:行者123 更新时间:2023-12-05 08:46:54 27 4
gpt4 key购买 nike

我在 repl.it 上托管我的 discord 机器人时遇到错误
我得到这个错误,

/home/runner/JU-Bot/node_modules/discord.js/src/rest/RESTManager.js:32
const token = this.client.token ?? this.client.accessToken;
^

SyntaxError: Unexpected token '?'

它在我的本地机器上工作得很好。

最佳答案

??nullish coalescing operator .您的错误意味着您正在运行不支持它的 node.js 版本。您需要至少升级到节点版本 14 才能访问此功能。不幸的是,repl.it does not support升级到更新的版本,除非在创建 repo 时已经有一个版本。

关于discord.js - 意外的 token '?' discord.js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68730332/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com