【发布时间】:2018-08-10 11:15:39
【问题描述】:
我试图关注https://codelabs.developers.google.com/codelabs/smarthome-washer/#2
但我在第 3 步中遇到了 firebase deploy。
第一个错误:
Error: package.json in functions directory has an engines field which is unsupported. The only valid choices are: {"node": "8"} and {"node": "6"}.
在我将 package.json 文件更改为使用“node”:“8”后,出现以下错误:
Error: Error occurred while parsing your function triggers.
TypeError: Cannot read property 'databaseURL' of undefined
at RepoManager.databaseFromApp (/Users/prafulll/code/personal/direkshanProjects/googleAssistant/smarthome-washer/washer-start/functions/node_modules/@firebase/database/dist/index.node.cjs.js:14985:39)
at Object.instance.INTERNAL.registerService.Reference [as database] (/Users/prafulll/code/personal/direkshanProjects/googleAssistant/smarthome-washer/washer-start/functions/node_modules/@firebase/database/dist/index.node.cjs.js:15526:130)
at FirebaseAppImpl._getService (/Users/prafulll/code/personal/direkshanProjects/googleAssistant/smarthome-washer/washer-start/functions/node_modules/@firebase/app/dist/index.cjs.js:134:66)
at FirebaseAppImpl.(anonymous function) [as database] (/Users/prafulll/code/personal/direkshanProjects/googleAssistant/smarthome-washer/washer-start/functions/node_modules/@firebase/app/dist/index.cjs.js:323:31)
at Object.serviceNamespace [as database] (/Users/prafulll/code/personal/direkshanProjects/googleAssistant/smarthome-washer/washer-start/functions/node_modules/@firebase/app/dist/index.cjs.js:308:32)
at Object.<anonymous> (/Users/prafulll/code/personal/direkshanProjects/googleAssistant/smarthome-washer/washer-start/functions/index.js:28:30)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
Having trouble? Try firebase deploy --help
我该怎么办?或者是否有人知道任何其他资源来学习构建 google home 操作?
【问题讨论】:
-
您是否尝试过使用节点 6?
-
是的,我做了@NickFelker 还是同样的错误
-
第 28 行发生了什么?你有什么改变吗?
-
没什么。还是一样——const firebaseRef = firebase.database().ref('/');
-
你能暂时回到以前版本的 firebase-tools 吗?
npm install firebase-tools@3.19.3。然后使用./node_modules/.bin/firebase deploy调用 deploy。
标签: node.js firebase actions-on-google firebase-cli google-smart-home