我正在使用google firebase函数为imagemagic生成图像的缩略图,我完全按照this link中提到的那样做了 我也经历过this link。
使用gcloud app deploy命令部署时,我收到以下异常。我已经浏览了与此问题类似的其他SO帖子(link)。
我也使用(npm install -g firebase-tools)更新了firebase工具。我还缺少什么呢?
在例外中说 在对象。 (/app/lib/functions.js:43:47)在第43行,代码片段看起来像这样
exports.generateThumbnail = functions.storage.object().onChange(event => {
异常情况如下
Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error:
> nodejs-getting-started@1.0.0 start /app
> node app.js
/app/node_modules/firebase-functions/lib/config.js:51
throw new Error('Firebase config variables are not available. ' +
^
Error: Firebase config variables are not available. Please use the latest version of the Firebase CLI to deploy this function.
at init (/app/node_modules/firebase-functions/lib/config.js:51:15)
at Object.config (/app/node_modules/firebase-functions/lib/config.js:29:9)
at Object.object (/app/node_modules/firebase-functions/lib/providers/storage.js:41:27)
at Object.<anonymous> (/app/lib/functions.js:43:47)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "/nodejs/bin/node" "/nodejs/bin/npm" "start"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! nodejs-getting-started@1.0.0 start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nodejs-getting-started@1.0.0 start script 'node app.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the nodejs-getting-started package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs nodejs-getting-started
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls nodejs-getting-started
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /app/npm-debug.log