【问题标题】:Nodejs application (Developed using typescrpt not in javascript) deployment issue on Firebase using "firebase serve" command使用“firebase serve”命令在 Firebase 上部署 Node Js 应用程序(使用 typescript 而非 javascript 开发)部署问题
【发布时间】:2020-07-28 19:48:28
【问题描述】:

尝试在谷歌云(即 firebase)上部署 nodejs API 并出现以下错误。 步骤:

  1. 在函数文件夹中运行 tsc src\index 以编译 typescript 文件。
  2. 运行“firebase serve”(错误 1)还尝试了“firebase serve --only functions,hosting”(错误 2)
  3. 出现以下错误

在编译和部署之前多次尝试使用 npm install typescript 以及 npm install -g typescript 安装 typescript。但仍然得到同样的错误。请找到我的项目的文件夹结构的附件。因此,我已将 .vscode 文件夹及其文件明确移动到函数文件夹中。

【问题讨论】:

    标签: node.js typescript firebase


    【解决方案1】:

    已经解决了。我有一个缺少的包是 tslint。所以我按照以下步骤操作,它已经解决了这个问题。这是一个非常愚蠢的 -

    1. npm install tslint
    2. npm 运行构建

    Build 将提供所有警告和错误,我在 package.json 中进行了相应的更改。

    如需更多参考,请查找 firebase 文档链接 - https://firebase.google.com/docs/functions/typescript

    【讨论】:

      猜你喜欢
      • 2014-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-30
      • 2019-04-30
      • 2012-03-14
      • 2016-04-23
      • 1970-01-01
      相关资源
      最近更新 更多