尝试从节点8升级到节点10 (instructions are simple),但在尝试运行时仍然出现错误,例如。“导出:意外的标记‘SyntaxError’”
我正在使用最新的工具(Firebase工具: 8.9.2)和。我不是在经营林特。
有什么想法吗?
//relevant files in package.json:
{
"engines": {
"node": "10"
},
"dependencies": {
"firebase-admin": "^8.10.0",
"firebase-functions": "^3.11.0",
},
}代码比较
//previous code in node 8, does not error
exports.A = functions.pubsub
.schedule("0 22 * * *")
.onRun(() => bigQueryDump());//code in node 10, throws error
export const A = functions.pubsub
.schedule("0 22 * * *")
.onRun(() => bigQueryDump());发布于 2020-10-02 20:58:28
您已将代码从exports.A = ...更改为export const A。
无论是在the medium post you shared中还是在official documentation中,都没有提到需要进行此更改。
此外,该错误表明它不理解export。
将它改回exports.A应该可以解决这个问题。
您可以看到这仍然是节点10的格式的examples in the docs。
https://stackoverflow.com/questions/63644107
复制相似问题