【发布时间】:2019-05-23 18:31:33
【问题描述】:
发出命令“firebase serve --only functions,hosting”后出现以下错误消息
! AssertionError [ERR_ASSERTION]: missing path
at Module.require (module.js:594:3)
at require (internal/module.js:11:18)
at InitializeFirebaseAdminStubs (C:\Users\Sushanth\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:231:18)
at C:\Users\Sushanth\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:451:9
at Generator.next (<anonymous>)
at C:\Users\Sushanth\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:7:71
at new Promise (<anonymous>)
at __awaiter (C:\Users\Sushanth\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:3:12)
at main (C:\Users\Sushanth\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:421:12)
at Object.<anonymous> (C:\Users\Sushanth\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:511:5)
! Your function was killed because it raised an unhandled error.
^CTerminate batch job (Y/N)? Y
下面是我执行的命令
firebase 服务 --only 功能,托管
收到一条消息,我需要从 6.4.0 -> 6.9.2 更新“运行 npm i -g firebase-tools 进行更新”再次更新后运行服务并收到消息“更新可用 6.9.2 → 6.10.0”,我再次运行更新。
更新了 firebase-admin 以及“npm i -g firebase-admin@latest”
再次运行“firebase serve --only 功能,托管”开始在 firebase-functions-test 上看到以下消息。在函数文件夹中运行提到的命令。
+ functions: Using node@8 from host.
+ functions: Emulator started at http://localhost:5001
i functions: Watching "D:\BigData\13. Firebase\FB-BTD\FB-BTD\functions" for Cloud Functions...
i hosting: Serving hosting files from: public
+ hosting: Local server: http://localhost:5000
! The Cloud Functions emulator requires the module "firebase-functions-test" to be installed as a development dependency. To fix this, run "npm install --save-dev firebase-functions-test" in your functions directory.
i functions: Your functions could not be parsed due to an issue with your node_modules (see above)
[hosting] Rewriting / to http://localhost:5001/btd-in2-20180718/us-central1/app for local Function app
i functions: Beginning execution of "app"
! The Cloud Functions emulator requires the module "firebase-functions-test" to be installed as a development dependency. To fix this, run "npm install --save-dev firebase-functions-test" in your functions directory.
- 下次我运行 firebase serve 时,我收到了上述错误消息。
因此,我无法在本地测试 web nodejs firebase 代码。
【问题讨论】:
-
请在 firebase-tools GitHub 上发布问题。 Stack Overflow 并不是真正适合报告错误的地方。 github.com/firebase/firebase-tools
-
问题已在上述链接中提出。
标签: node.js firebase-realtime-database google-cloud-functions firebase-admin