【问题标题】:'Error: unable to verify the first certificate' when trying to start discord bot尝试启动不和谐机器人时出现“错误:无法验证第一个证书”
【发布时间】:2019-03-09 05:37:44
【问题描述】:

我在使用 Visual Studio Code 和 Node 设置不和谐机器人时遇到错误。
这是使机器人上线的代码:

const Discord = require('discord.js');
const bot = new Discord.Client();
bot.login('[the token i recieved for my bot]');

我从运行这个得到的错误是:

(node:7064) UnhandledPromiseRejectionWarning: Error: unable to verify the first certificate    warning.js:18
 at TLSSocket.onConnectSecure (_tls_wrap.js:1049:34)
 at TLSSocket.emit (events.js:182:13)
 at TLSSocket._finishInit (_tls_wrap.js:631:8)
(node:7064) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either 
 by throwing inside of an async function without a catch block, or by rejecting a promise which was not
 handled with .catch(). (rejection id: 2)    warning.js:18
(node:7064) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future,
 promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.    warning.js:18

任何人都可以帮我调试这个或不得到这个错误吗?

【问题讨论】:

  • 使用 Visual Studio Code 是什么意思?你只是用它来编写机器人还是通过 Visual Studio Code 中的一些插件或包来运行它?

标签: node.js visual-studio-code discord.js


【解决方案1】:

使用完全相同的设置,我无法重现您的错误。

discord.js: v11.4.2Visual Studio Code: v1.28.2

如果您仍然遇到此问题,maybe this can help you

【讨论】:

    猜你喜欢
    • 2020-08-29
    • 2020-12-23
    • 1970-01-01
    • 2021-12-14
    • 2019-02-20
    • 1970-01-01
    • 2022-09-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多