firebase - 在哪里可以找到 Firebase 部署错误日志?

标签 firebase logging npm deployment google-cloud-functions

我使用 Firebase CLI 执行了 firebase deploy --only functions:helloWorld 来部署我的函数。

这是我在终端上看到的:

Build failed: npm ERR! Maximum call stack size exceeded

npm ERR! A complete log of this run can be found in:
npm ERR!     /builder/home/.npm/_logs/2020-09-03T11_53_55_738Z-debug.log; Error ID: 49341d49

在 GCP 日志上:

Cloud Functions
UpdateFunction
us-central1:helloWorld
me@gmail.com
Build failed: npm ERR! Maximum call stack size exceeded npm ERR! A complete log of this run can be found in: npm ERR! /builder/home/.npm/_logs/2020-09-03T10_51_08_513Z-debug.log; Error ID: 49341d49

问题是,我在哪里可以找到这个文件 /builder/home/.npm/_logs/2020-09-03T10_51_08_513Z-debug.log 检查它的内容?

我打开了 GCP 的云外壳,但是当我从 root 中 ls 时,没有 /builder 这样的文件夹

编辑:

在运行 npm cache clear 时,我看到了这些日志,并认为 /Users/me/home/.npm/_logs 下可能有一些东西:

npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. On the other hand, if you're debugging an issue with the installer, you can use `npm install --cache /tmp/empty-cache` to use a temporary cache instead of nuking the actual one.
npm ERR!
npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/me/.npm/_logs/2020-09-03T16_43_51_810Z-debug.log

所以我继续执行 ls -als ~/.npm/_logs/,我在那里看到一些较旧的日志,但没有匹配的 2020-09-03T10_51_08_513Z-debug.log 或较新的 firebase deploy 命令

最佳答案

您在 Firebase 控制台中查看 Cloud Functions 的日志,如屏幕截图所示 enter image description here

或者使用 Firebase CLI 要使用 firebase 工具查看日志,请使用 functions:log 命令:

firebase functions:log

要查看特定函数的日志,请提供函数名称作为参数:

firebase functions:log --only <FUNCTION_NAME>

有关完整的日志查看选项,请查看函数的帮助:日志:

firebase help functions:log

关于firebase - 在哪里可以找到 Firebase 部署错误日志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63723284/

相关文章:

android - 连接到 firebase auth appcompat-v7 :28. 0.0 错误

java - 单击 RecyclerView 项目时出现 NullPointerException

java - EssentialFilter play framework java(记录时间)

java - 使用 log4j 在日志文件中打印线程 ID

npm 挂起从 artifactory 中拉取依赖项

ios - 即使启用了后台模式和推送通知,Firebase 电话身份验证也会在 iOS 上弹出一个 reCAPTCHA 验证窗口

javascript - 在 View 更改之前, Angular 值不会反射(reflect)在范围中

logging - Grails 1.1.1 log4j DSL 为 PatternLayout 配置抛出 MissingMethodException

node.js - 如何使用 grunt 将编译好的 Jade 文件复制到目标文件夹

javascript - Node.js 项目依赖的过度递归