程序问答   发布时间:2022-06-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Firebase Cloud Function 的 Angular 10 Universal Build 中缺少 package.json大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决Firebase Cloud Function 的 Angular 10 Universal Build 中缺少 package.json?

开发过程中遇到Firebase Cloud Function 的 Angular 10 Universal Build 中缺少 package.json的问题如何解决?下面主要结合日常开发的经验,给出你关于Firebase Cloud Function 的 Angular 10 Universal Build 中缺少 package.json的解决方法建议,希望对你解决Firebase Cloud Function 的 Angular 10 Universal Build 中缺少 package.json有所启发或帮助;

我正在尝试将 Angular 10 通用应用程序部署到 Firebase 云函数。但是,部署失败,因为 firebase Cli 工具在“dist”目录中找不到“package.Json”文件。运行 npm run build:ssr 不会生成文件,但它会生成一个包含“浏览器”和“服务器”目录的工作构建,我可以使用 npm run serve:ssr 提供这些目录。

将 Angular Universal 部署到 Firebase 的在线指南似乎都过时了。例如,他们提到使用 Webpack,我认为不再需要。

我从一个干净的项目开始。我添加的只是 ng add @nguniversal/express-ENGIneng add @angular/fire。然后在 functions 目录中,我复制了我的构建并创建了一个 Firebase 函数。

import * as functions from 'firebase-functions';
const universal = require(`${process.cwd()}/dist/ssr-test/server/main.Js`).app;

export const ssr = functions.https.onrequest(universal);

也许自动生成的 angular.Jsonfirebase.Json 文件有问题?

更新(2021 年 2 月 3 日)

发现了问题。我将很快在此处发布,并为将来遇到此问题的任何人提供分步说明。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

大佬总结

以上是大佬教程为你收集整理的Firebase Cloud Function 的 Angular 10 Universal Build 中缺少 package.json全部内容,希望文章能够帮你解决Firebase Cloud Function 的 Angular 10 Universal Build 中缺少 package.json所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。