【发布时间】: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