【问题标题】:When are the dependencies of a Firebase Function installed on the hosting server? On deploy?Firebase 函数的依赖项何时安装在托管服务器上?部署时?
【发布时间】:2019-01-16 17:41:57
【问题描述】:

根据https://firebase.google.com/docs/functions/handle-dependencies

“如果您通过 Firebase CLI 进行部署,本地 node_modules 文件夹将被忽略,您必须在 package.json 中指定您的依赖项”

因此,package.json 中的依赖项是否在部署时安装在托管服务器中?

【问题讨论】:

  • 是的,否则代码将无法工作。很确定部署在服务器上运行npm install

标签: firebase google-cloud-functions firebase-cli


【解决方案1】:

Cloud Functions 将在部署后有效地 npm install 获取您的代码的所有依赖项,如 package.json 中指定的那样。

【讨论】:

  • 这是确保一切都是最新的唯一方法。
  • 那他怎么安装本地依赖(使用lerna monorepo范式)?
猜你喜欢
  • 2021-06-05
  • 2017-06-10
  • 2015-10-27
  • 2016-08-16
  • 1970-01-01
  • 2021-02-22
  • 2019-06-07
  • 2021-08-23
  • 2016-08-23
相关资源
最近更新 更多