所以这是我观看的教程:https://www.youtube.com/watch?v=LOeioOKUKI8&t=865s 基本上,我正在尝试通过Firebase对网页进行本地托管,并且该网页一直失败,这是我在BASH控制台上遇到的错误。
\
我确实在我的功能目录中安装了npm,并且我也将npm我-将firebase-functions保存在我的功能目录中。
i functions: Preparing to emulate functions.
i hosting: Serving hosting files from: public
✔ hosting: Local server: http://localhost:5000
Warning: You're using Node.js v12.1.0 but the Google Cloud Functions runtime is only available in Node.js 6 (Deprecated), Node.js 8, and Node.js 10 (Beta). Therefore, results from running emulated functions may not match production behavior.
⚠ functions: Failed to load functions source code. Ensure that you have the latest SDK by running npm i --save firebase-functions inside the functions directory.
⚠ functions: Error from emulator. Error parsing triggers: Cannot find module 'consolidate'
Try running "npm install" in your functions directory before deploying.
答案 0 :(得分:0)
在“功能”目录中,运行:
npm i handlebars consolidate --save
这将安装两个依赖关系,然后可以通过在代码中要求它们来使用它们。