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