【发布时间】:2020-07-14 17:09:18
【问题描述】:
我对 Discord 机器人的编码还很陌生,但我做了一些我想托管的东西。
我去了 vultr.com 并获得了所需的一切,并按照教程让我的机器人 24/7 在线。
在我不得不启动机器人之前,一切都很顺利。每次我启动它时,状态都是在线的,但是当我打开日志时,它给了我这个错误。我可以看到错误在 discord.js 文件中的某处。
我尝试卸载和安装 discord.js 几次,但没有成功。
有人知道这个错误的解决方法吗?
0|index | /root/artbot/node_modules/discord.js/src/client/Client.js:41
0|index | } catch {
0|index | ^
0|index |
0|index | SyntaxError: Unexpected token {
0|index | at createScript (vm.js:80:10)
0|index | at Object.runInThisContext (vm.js:139:10)
0|index | at Module._compile (module.js:616:28)
0|index | at Object.Module._extensions..js (module.js:663:10)
0|index | at Module.load (module.js:565:32)
0|index | at tryModuleLoad (module.js:505:12)
0|index | at Function.Module._load (module.js:497:3)
0|index | at Module.require (module.js:596:17)
0|index | at Module.Hook._require.Module.require
(/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:80:39)
0|index | at require (internal/module.js:11:18)
【问题讨论】:
标签: node.js terminal bots discord.js filezilla