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

我使用 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 的日志,如屏幕截图所示

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

firebase functions:log

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

firebase functions:log --only <FUNCTION_NAME>

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

firebase help functions:log

https://stackoverflow.com/questions/63723284/

相关文章:

reactjs - CRA typescript环境导出类型时如何解决解析错误

react-native - 如何使选项卡栏图标的溢出在 React Native 中可点击?

python - 为什么在 Python 3.x 中的循环中使用 list() 会返回内存错误?

javascript - select2 on select data-select2-id 属性添

mysql - 如何使用 SQLAlchemy 为 RDS 代理设置 TLS

react-native - 如何在没有 Firebase 的情况下为 React Native A

react-native - 在 React Native 中访问 DOM 元素

python - 使用 tokenizer.encode_plus 时遇到问题

post - ESP32 异步 Web 服务器 POST 方法不起作用

typescript - 数字和通用参数之间的区别