简体   繁体   English

带有最新节点版本的异步 Function 上的“解析错误:意外令牌功能”

[英]"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.

相关问题 如何修复节点中的“解析错误:意外的令牌 =&gt;”? - how to fix 'parsing error: Unexpected token =>' in node? 无法从源加载函数定义:无法从函数源生成清单:SyntaxError:意外的标记“。” - Failed to load function definition from source: Failed to generate manifest from function source: SyntaxError: Unexpected token '.' 异步 function 本机反应 - Async function react native 错误:意外标记:< @ 第 1 行,第 1 列。<!--?xml version="1.0" encoding="utf-8"?--> - error:unexpected token: < @ line 1, column 1. <?xml version="1.0" encoding="utf-8"?> 如何使用带有 nodejs 的异步 function 路由检查 JWT 令牌是否有效? - How can i check a JWT token is valid using an async function route with nodejs? 部署 Firebase 和 Node.js 应用程序导致错误:Error: Parse Error in remoteconfig.template.json: Unexpected token 'i' at 1:1 - Deploying Firebase and Node.js application results in error: Error: Parse Error in remoteconfig.template.json: Unexpected token 'i' at 1:1 我想用令牌重置密码但是 => SyntaxError: await is only valid in async function - i want to reset password with token but => SyntaxError: await is only valid in async function 节点和 DialogFlow 错误:UnhandledPromiseRejectionWarning:TypeError:sessionClient.projectAgentSessionPath 不是 function - Node and DialogFlow Error: UnhandledPromiseRejectionWarning: TypeError: sessionClient.projectAgentSessionPath is not a function 运行 firebase 部署时,在 flutter 应用程序上 1:1 时解析错误意外令牌 '��' - Parse error Unexpected token '�' at 1:1 ��{ on flutter app when running firebase deploy firebase.firestore 不是 function 版本 9 - firebase.firestore is not a function version 9
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM