gpt4 book ai didi

node.js - app.yaml 与 main.js 位于不同的目录中?

转载 作者:太空宇宙 更新时间:2023-11-04 02:07:13 25 4
gpt4 key购买 nike

我有一个 Node.JS 应用程序想要部署在 AppEngine 上。目前我收到以下错误:

Beginning deployment of service [default]...
Building and pushing image for service [default]
ERROR: node.js checker: Neither "start" in the "scripts" section of "package.json" nor the "server.js" file were found.
ERROR: (gcloud.app.deploy) Your application does not satisfy all of the requirements for a runtime of type [nodejs]. Please correct the errors and try again.

这是有道理的,因为这是文件夹结构:

  • 客户端
  • 服务器
    • main.js
  • app.yaml

如您所见,我有一个单独的文件夹用于存放客户端代码和服务器代码。如果我将 app.yaml 文件放入服务器文件夹中,则部署可以正常工作,但是当我尝试访问该应用程序时,它无法找到客户端文件,因为它们不是部署的一部分。

是否可以在 app.yaml 中进行配置,或者我是否需要重构我的应用程序?

最佳答案

实际上应用程序引擎需要在根目录中的package.json...并在其中放置启动脚本..如start:node server/main.js

关于node.js - app.yaml 与 main.js 位于不同的目录中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43786161/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com