当我尝试运行firebase deploy以在新项目上部署我的云功能时,我得到了TypeError: checkForNode8 is not a function
。我对云功能并不陌生,它适用于我的旧项目,但新项目会出现这个错误。我尝试过更新npm更新firebase工具,重新安装它们,我能想到的一切。我似乎在谷歌上找不到关于这个错误的任何东西。我已经做了好几个小时了。任何帮助都将不胜感激。这是调试日志的一个片段:
...
[info]
[info] === Deploying to 'woop-5c6c3'...
[info]
[info] i deploying functions
[info] Running command: npm --prefix "$RESOURCE_DIR" run lint
[info] ✔ functions: Finished running predeploy script.
[debug] [2020-12-16T06:38:25.931Z] > [functions] package.json contents: {
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"lint": "eslint .",
"serve": "firebase emulators:start --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "12"
},
"main": "index.js",
"dependencies": {
"firebase-admin": "^9.2.0",
"firebase-functions": "^3.11.0"
},
"devDependencies": {
"eslint": "^5.12.0",
"eslint-plugin-promise": "^4.0.1",
"firebase-functions-test": "^0.2.0"
},
"private": true
}
[info] i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
[info] i functions: ensuring required API cloudbuild.googleapis.com is enabled...
[debug] [2020-12-16T06:38:27.300Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/woop-5c6c3/services/cloudfunctions.googleapis.com
...
[debug] [2020-12-16T06:39:33.357Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Wed, 16 Dec 2020 06:39:33 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"","accept-ranges":"none","transfer-encoding":"chunked"}
[info] ✔ functions[newDriverRequest(us-central1)]: Successful update operation.
[debug] [2020-12-16T06:39:33.537Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Wed, 16 Dec 2020 06:39:33 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-16T06:39:35.543Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/d29vcC01YzZjMy91cy1jZW50cmFsMS91cGRhdGVEcml2ZXJSZXF1ZXN0L3hPcTlvNVJ5YzRV
[debug] [2020-12-16T06:39:36.021Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Wed, 16 Dec 2020 06:39:36 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"","accept-ranges":"none","transfer-encoding":"chunked"}
[info] ✔ functions[updateDriverRequest(us-central1)]: Successful update operation.
[debug] [2020-12-16T06:39:36.026Z] TypeError: checkForNode8 is not a function
at _fetchTriggerUrls.then.then (/usr/local/lib/node_modules/firebase-tools/lib/deploy/functions/release.js:413:13)
at process._tickCallback (internal/process/next_tick.js:68:7)
[error]
[error] Error: An unexpected error has occurred.
这是CLI中的一个错误,已在v9.0.1中修复——只需更新到最新版本,您就可以继续使用了。