[英]"Parsing Error: unexpected token function" on Async Function with a recent Node version
I am working on a side project, using node and firebase.我正在使用节点和 firebase 做一个辅助项目。
I can create regular functions and cloud functions, but when I try to create an async one like this:我可以创建常规函数和云函数,但是当我尝试创建这样的异步函数时:
async function getApartments(){...}
I have this error: "ESLint: Parsing error: Unexpected token function"我有这个错误:“ESLint:解析错误:意外的令牌函数”
I saw on others posts ( here ) this can be linked to using Async functions on an old version of node, but since I'm on a recent version of node (17.8) I really don't understand the problem.我在其他帖子( here )上看到这可以链接到在旧版本的节点上使用异步函数,但由于我使用的是最新版本的节点(17.8),我真的不明白这个问题。
Thanks in advance,提前致谢,
Good morning, Do you use eslint?早上好,你用 eslint 吗? if yes ->
如果是 ->
{
"parserOptions": {
"ecmaVersion": 2017 @see https://eslint.org/docs/latest/user-guide/configuring/language-options
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.