firebase - Firebase 函数的目标部署
问题描述
我正在尝试为 Firebase Functions 设置目标部署。 https://firebase.google.com/docs/cli/targets
这是 firebase.json 文件
{
"functions": [{
"target": "production",
"source": "src/prod/functions",
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint",
"npm --prefix \"$RESOURCE_DIR\" run build"
]
}]
}
预部署运行正常,但部署时出错
functions[prod]: Finished running predeploy script.
Error: An unexpected error has occurred.
如果我去 firebase-debug.log 它显示:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
将 Functions 文件夹放在项目根目录上,它将正常部署。
这里缺少什么?
解决方案
尝试运行firebase init
并尽可能设置选项,这样它就不会覆盖您现有的项目。我必须从父目录运行它,/functions
否则它将创建一个新目录,但也许有一些选项可以设置不同的目录名称以适合您的情况。
推荐阅读
- google-apps-script - importrange 使用循环复制多个电子表格以更改源 URL
- node.js - 手动登录用户 - Passport.js?
- sapui5 - sap.ui.table.Table 和 sap.ui.table.TreeTable 不显示最后一个数据行
- java - 在 Codility GenomicRangeQuery 测试中无法通过性能
- excel - 如何将函数 INDEX(MATCH... 转换为 VBA 代码
- flutter - 如何使 Flutter 中的 ListView onPressed 中的图标不可见?
- airflow - Airflow 1.9 运行时将优先级权重分配给 DagRuns
- r - How to subset one dataframe and make it equal to corresponding dataframes in r?
- javascript - 第一次单击时未执行的功能
- python - 按名称从字典中提取数据框