Node.js 指示超出文件末尾的意外标记
我正在 Node.js 中开发一个非常简单的机器人,但它不会再启动了。 Node.js 指示意外令牌错误,但列出的行号超出了文件末尾。具体来说,错误是:
C:\Users\Owner\Bot\jovial_bot.js:294
});
^
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
SyntaxError: Unexpected token )
at Module._compile (module.js:427:25)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Array.0 (module.js:470:10)
at EventEmitter._tickCallback (node.js:192:40)
The last line in the program is } );
但是,最后一行是第 293 行。在文件末尾添加换行符会增加 Node.js 报告的行号。据我所知,我没有任何不匹配的括号。我尝试将 ( 添加到文件末尾,错误更改为“意外的标记}”。添加“ ({”将错误更改为“意外的输入结束”。我不知道在哪里继续。谢谢 我的代码
在这里:http://jsfiddle.net/kunkelwe/VEBtH/ 我正在使用这个 API: https://github.com /alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js
I'm developing a pretty simple bot in Node.js, and it won't launch anymore. Node.js is indicating an unexpected token error, but the line number listed is past the end of the file. Specifically, the error is:
C:\Users\Owner\Bot\jovial_bot.js:294
});
^
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
SyntaxError: Unexpected token )
at Module._compile (module.js:427:25)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Array.0 (module.js:470:10)
at EventEmitter._tickCallback (node.js:192:40)
The last line in the program is } );
However, the last line is line number 293. Adding newlines to the end of the file increases the line number reported by Node.js. As far as I can tell, I do not have any unmatch parenthesis. I tried adding ( to the end of the file, and the error changed to "Unexpected token }". Adding " ({ " changed the error to "Unexpected end of input". I don't know where to continue with this. Thank you in advance for the help.
My code is here: http://jsfiddle.net/kunkelwe/VEBtH/
And I'm using this API: https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您在
102
行缺少}
。您在74
行打开了一个名为toggle_mode
的函数,但从未放置过结束}
。You are missing a
}
on line102
. You open a function calledtoggle_mode
on line74
but you never put a closing}
.