rest - 运行 discord.js bot 时出现此错误
问题描述
当我使用 discord.js 运行不和谐机器人时
[my\path\discord.js\bot]
> node bot.js
C:\Users\username\node_modules\discord.js\src\rest\APIRequest.js:33
agent ??= new https.Agent({ ...this.client.options.http.agent, keepAlive: true });
^^^
SyntaxError: Unexpected token '??='
at wrapSafe (internal/modules/cjs/loader.js:1001:16)
at Module._compile (internal/modules/cjs/loader.js:1049:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.<anonymous> (C:\Users\username\node_modules\discord.js\src\rest\RESTManager.js:4:20)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
[my\path\discord.js\bot]
>
我认为这是休息客户端语法错误我该如何解决?
解决方案
推荐阅读
- java - 除了匿名类之外,java类的成员可以没有完全限定名吗?
- javascript - 我想改变我的 json 结构,我该怎么做?
- crm - Zoho CRM 自定义函数 Deluge 脚本使用不同日期字段的年份更新日期字段
- javascript - 用 JS 移动 div(已编辑)
- git - 如何将默认文件夹更改为 git-azure 存储库中的持续部署?
- asp.net - 无法将 CSHTML 中的视图模型列表传递给控制器
- scala - 如何在 vs 代码中调试 scala sbt 项目
- java - 如何将上一步的 Mono<> 结果传递给下一个 doOnSuccess() 方法
- java - 将外部文件夹添加到可运行 jar 中的 ClassPath
- android - Android 9+ 不提供来电号码