【问题标题】:Firebase hosting doesn't let me deploy bc firebase-functions is outdatedFirebase 托管不允许我部署 bc firebase-functions 已过时
【发布时间】:2020-11-05 03:07:37
【问题描述】:
functions: package.json indicates an outdated version of firebase-functions.
Please upgrade using npm install --save firebase-functions@latest in your functions directory.

=== Deploying to 'zootopia-mysite'...

i  deploying functions, hosting
Running command: npm --prefix "$RESOURCE_DIR" run lint

> functions@ lint /Users/zootopia/functions
> eslint .

✔  functions: Finished running predeploy script.

Error: There was an error reading functions/package.json:

 Engines field is required but was not found in functions/package.json.
To fix this, add the following lines to your package.json: 

      "engines": {
        "node": "10"
      }

我也尝试使用 npm install --save firebase-functions@latest 进行升级,但它仍然给我同样的错误。

【问题讨论】:

    标签: firebase google-cloud-functions package.json firebase-hosting firebase-cli


    【解决方案1】:

    您的本地项目显然适用于 Firebase 托管和 Cloud Functions。错误消息告诉您 Cloud Functions 部署失败,这与 Firebase 托管没有任何关系。

    如果您尝试遵循此处输出的建议,您将不得不更改到“functions”文件夹并运行 npm 命令来升级旧模块并对 package.json 进行任何其他更改。

    【讨论】:

    • 非常感谢!我进入我的笔记本电脑的根目录到 users//functions 并且能够编辑 package.json 但是在我部署之后,我被带到了这个:
    • Firebase 托管设置完成 您看到此消息是因为您已成功设置 Firebase 托管。现在是时候去建造一些非凡的东西了! ,那么我如何实际查看我创建的网站
    • 我不知道,我看不到你部署的内容。 Firebase 托管只会上传您在“公共”中拥有的任何内容。
    • 谢谢!我想通了,我在 users/ 目录中执行 firebase init,但我删除了该目录中的 firebase.json 文件并 cd'd 进入 users//Desktop/ 目录并运行 firebase init 然后 firebase deploy 我现在可以在我的托管 URL 上看到它!
    猜你喜欢
    • 2017-08-14
    • 2020-01-14
    • 2020-02-27
    • 2017-11-03
    • 2017-01-22
    • 2020-10-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多