我试图在firebase上部署node.js函数,但收到以下错误:
this.INTERNAL=new FirebaseNamespaceInternal(appStore??new lifecycle_1.appStore(((
我尝试部署的命令是:
firebase部署--仅在主目录中//执行功能
firebase deploy--仅函数目录中的函数//
但仍然会出错。在检查过去遇到类似问题的其他人时,检查了package.json,可以看到"发动机":{"节点":"16〃;},
错误消息
Error: Error occurred while parsing your function triggers.
/Users/akhil/pixNodes/node_modules/firebase-admin/lib/app/firebase-namespace.js:84
this.INTERNAL = new FirebaseNamespaceInternals(appStore ?? new lifecycle_1.AppStore());
^
SyntaxError: Unexpected token '?'
at wrapSafe (internal/modules/cjs/loader.js:1053:16)
at Module._compile (internal/modules/cjs/loader.js:1101:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/Users/akhil/pixNodes/node_modules/firebase-admin/lib/default-namespace.js:19:30)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
我遇到了同样的问题。更新节点版本修复了它。我将节点版本更新为16